Log in

View Full Version : Random character output with php in safari on iphone5



?foru
10-10-2014, 09:06 PM
I'm not sure if this a server configuration issue, or what the case might be.

If I simply use
<?php echo "hello!" ?>

Safari on an iphone5 outputs the following...hello!0

With other longer pages it displays other various random characters in the header/body/footer.

Using
<?php header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); ?> relieves this odd output, but I shouldn't have to add this in every page that's on this particular linux server.

Any suggestions on what might be causing this? Page output seems to be ok on desktop PC and Mac in multiple browsers.

Thank you

james438
10-10-2014, 09:12 PM
<?php echo "hello!" ?>
should be:

<?php echo "hello!"; ?>
You had a missing semicolon. The weird output is probably an iphone5 oddity.

?foru
10-10-2014, 09:18 PM
Thank you for the catch. It's been a long day, not sure how I missed that. :D

I still get the same thing with the semicolon. Maybe over the weekend I'll update to iOS8 on the 5s to see if it resolves itself.