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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -