Beginner PHP Issue

This is a very basic PHP question. I just started today on a project. I am actually trying to get some MySQL work done but I start with some basic “write some text” and it did not work properly.

This is my php file

[php]

PHP Test <?php echo "

One line simple string

"; echo "

Two line simple string example

"; echo "

Tomorrow I \'ll learn PHP global variables

"; ?> [/php] AND this is what I get. It is not what I expected.

One line simple string
"; echo "
Two line simple string example

"; echo "
Tomorrow I 'll learn PHP global variables

"; ?>

I was able to run phpinfo() and get a bunch of information using the following PHP

<?php phpinfo(); ?>

Confused in San Antonio…

Best regards — Ron

Odd. Running the same:

[php]<!doctype html>

PHP Test <?php echo "

One line simple string

"; echo "

Two line simple string example

"; echo "

Tomorrow I'll learn PHP global variables

"; ?> [/php]

I get the following.

Is that the entire file?

Thank you for the review.

I “retyped” the whole code in and got the right result. I believe I had some hidden characters somewhere but I am not sure where or what.

Thanks!

Ron

What editor were you using? That can make a difference.

Sponsor our Newsletter | Privacy Policy | Terms of Service