Getting PHP Variable Name Showing in PHP Pages

Q

Why am I getting <?= $someName ?> in my PHP script pages?

✍: FYIcenter.com

A
If you installed new PHP application to your Apache server, you may notice that some PHP pages are showing <?= $someName ?> in the output. This is because some Web server will interpret <?= $someName ?> as valid PHP expression statement, and some Web server will not.

One way to fix this issue is to convert the above PHP expressions into full print() statements like this:

... <?php print($sgHtmlTitle); ?>...

If you are writing new PHP applications, stop using <?= ... ?> PHP expression syntax. So your application will be more portable.

2006-12-09, 9014🔥, 0💬