php require not working as expected -


i have started playing php. first script works fine:

<?php echo "hello"; ?> 

when require following external php file result strange:

<?php require "gloo.php"; echo "hello"; ?> 

gloo.php contains single line of text:

$foo="foo1"; 

when run script browser displays contents of gloo.php:

$foo="foo1"hello

it if typed

echo "$foo='foo1'hello" 

what doing wrong? help!

gloo.php contains single line of text:

$foo="foo1"; 

this file requires <?php , ?> tags. way you've said "contains single line of text" assume not there. closing ?> tag optional way.


Comments