Re: How do I display the script file name?
| From: | Jason k Larson | Date: | Thu, 27 Feb 2003 17:45:22 +0000 |
| Subject: | Re: How do I display the script file name? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137439@lists.php.net to get a copy of this message | ||
Actually, echo can handle multiple arguments, which it thinks those are.
echo 'foo', "bar", $foobar; //one example
//echo x3
echo 'foo';
echo "bar";
echo $foobar;
echo 'foo'."bar".$foobar; //yet another echo example
There are even more complex ways too and, of course, the use of ()s ... but I think I've made my point.
HTH,
Jason k Larson
M.A.Bond wrote:
With the output you are getting you will not see the output from the .' '.
As it inserts a space into the ouputted text. There is an error after the
$_SERVER['PHP_SELF'] the , should be a . (is this just a typo in the
e-mail?)
Thanks
Mark
-----Original Message-----
From: Stephen Ford [mailto:stephen_ford@ntlworld.com] Sent: 27 February 2003 16:47
To: php-general@lists.php.net
Subject: Re: [PHP] How do I display the script file name?
Partial success. The code and output are shown below. There are no errors.
What does the ".' '." do pls. Have tried a variety of combinations to see
the effect. Nothing to see... :-(
===PHP==============
<?php
echo "<P>Line #1 ".' '.$_SERVER['PHP_SELF'], "</P>";
echo "<P>Line #2</P>";
echo "<P>Line #3</P>";
echo "<P>Line #4 ".' '.$_SERVER['SCRIPT_NAME'].' '.
$_SERVER['SCRIPT_FILENAME'].' '.
$_SERVER['PHP_SELF']."</P>";
echo "<P>Line #5</P>";
echo "<P>Line #6 ", __FILE__,"</P>";
?>
===IE6 display===============
Line #1
Line #2
Line #3
Line #4
Line #5
Line #6 <Pathname removed for security>
==================
Stephen