|
|
| Jonny T 2004-03-31, 10:32 am |
| hi,
i want to echo the string '<?php' in a php script like :
echo "<?php";
but when i try nothing gets displayed ...
if I use
echo "<\?php";
then the string is displayed as : <\?php
Is there anything I can do ??
| |
| Jon Kraft 2004-03-31, 10:32 am |
| Jonny T <jonnyt@someisp3.com> wrote:
> i want to echo the string '<?php' in a php script like :
>
> echo "<?php";
>
> but when i try nothing gets displayed ...
>
> if I use
>
> echo "<\?php";
>
> then the string is displayed as : <\?php
>
> Is there anything I can do ??
Yes, have a look at the HTML source.
JOn
| |
| Dennis Biletsky 2004-03-31, 10:32 am |
| use htmlspecialchars like this
$phpstrsp="<?php";
$phpstrsp=htmlspecialchars($phpstrsp);
echo $phpstrsp;
"Jonny T" <jonnyt@someisp3.com> ???????/???????? ? ???????? ?????????:
news:c4ek8o$ic3$1@sparta.btinternet.com...
> hi,
> i want to echo the string '<?php' in a php script like :
>
> echo "<?php";
>
> but when i try nothing gets displayed ...
>
> if I use
>
> echo "<\?php";
>
> then the string is displayed as : <\?php
>
> Is there anything I can do ??
| |
|
| Just looking at how I have done it succesfully in the past as....
$fp = fopen($savename, "w+");
fputs($fp, "<?php" . "\n");
//-Ike
"Jonny T" <jonnyt@someisp3.com> wrote in message
news:c4ek8o$ic3$1@sparta.btinternet.com...
> hi,
> i want to echo the string '<?php' in a php script like :
>
> echo "<?php";
>
> but when i try nothing gets displayed ...
>
> if I use
>
> echo "<\?php";
>
> then the string is displayed as : <\?php
>
> Is there anything I can do ??
| |
|
| "Jonny T" <jonnyt@someisp3.com> wrote in message
news:c4ek8o$ic3$1@sparta.btinternet.com...
> i want to echo the string '<?php' in a php script like :
>
> echo "<?php";
>
> but when i try nothing gets displayed ...
Try:
echo "<?php";
-or-
echo '<?php';
| |
| Ian.H 2004-03-31, 11:36 am |
| On Wed, 31 Mar 2004 14:23:21 +0000, Jonny T wrote:
> hi,
> i want to echo the string '<?php' in a php script like :
>
> echo "<?php";
>
> but when i try nothing gets displayed ...
>
> if I use
>
> echo "<\?php";
>
> then the string is displayed as : <\?php
>
> Is there anything I can do ??
echo '<php'
You need to use the HTML entities character for '<' which is '<'
(LessThan). This will also be valid (X)HTML too where '<?php' would not
even if it was displayed as you expected =)
Regards,
Ian
[XP honoured.. FU: comp.lang.php]
--
Ian.H
digiServ Network
London, UK
http://digiserv.net/
|
|
|
|