simple string echo being blank

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
angelic_devil
Forum Commoner
Posts: 74
Joined: Thu Apr 02, 2009 7:05 am

simple string echo being blank

Post by angelic_devil »

hi for the following code the o/p is blank..plzhelp

Code: Select all

 
<?php
$y="<idiot>";
echo $y;
?>
 
the o/p shud be <idiot>
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: simple string echo being blank

Post by flying_circus »

angelic_devil wrote:hi for the following code the o/p is blank..plzhelp

Code: Select all

 
<?php
$y="<idiot>";
echo $y;
?>
 
the o/p shud be <idiot>
right click -> view source
angelic_devil
Forum Commoner
Posts: 74
Joined: Thu Apr 02, 2009 7:05 am

Re: simple string echo being blank

Post by angelic_devil »

WAT?? ru joking...i want the string <idiot> to be printed on the screen ...not want to see the source
User avatar
flying_circus
Forum Regular
Posts: 732
Joined: Wed Mar 05, 2008 10:23 pm
Location: Sunriver, OR

Re: simple string echo being blank

Post by flying_circus »

angelic_devil wrote:WAT?? ru joking...i want the string <idiot> to be printed on the screen ...not want to see the source

Code: Select all

<?php
  $y = "<idiot>";
  echo htmlentities($y);
?>
angelic_devil
Forum Commoner
Posts: 74
Joined: Thu Apr 02, 2009 7:05 am

Re: simple string echo being blank

Post by angelic_devil »

thank u
Post Reply