Re: echo a string that contain <? and <?php

From: haoren (xuehong_sun_at_hotmail.com)
Date: 07/21/04


Date: 20 Jul 2004 19:26:58 -0700

I should have put the question in the context. In fact, the string is
received from user's input to the form of a browser. Thus, echo
htmlspecialchars($str); can solve the problem.

Thanks Michael and all you guys.
haoren

Michael Fesser <netizen@gmx.net> wrote in message news:<9taqf0dum09n6k87mo78nbitl762slf27p@4ax.com>...
> .oO(haoren)
>
> >How can I echo a string that contain <? and <?php?
> >
> >For example,
> >
> >$str="test <? and <?php echo";
> >echo $str;
>
> echo htmlspecialchars($str);
>
> http://www.php.net/htmlspecialchars
>
> Micha



Relevant Pages

  • Re: How do I test safe form input?
    ... > with the context of the form. ... If it is something you are going to echo back ... > to the browser, you do not care if somebody uses a semicolon; ...
    (comp.lang.php)
  • Export to csv
    ... I'm trying to generate a csv file from an ldap query (by generating a string by concatenating with comma's - echo of the string in the browser looks fine). ...
    (comp.lang.php)
  • Re: get pic from my mail
    ... header with header. ... output the string to the browser. ... echo imap_base64; ...
    (comp.lang.php)
  • Re: set user=%username%
    ... Your most recent feedback confirms that Windows is ... Type this: echo %MyName% ... > usertest=This is a long string. ...
    (microsoft.public.windows.server.general)
  • Re: its not the school home work
    ... I've learned a bit about strong quotes and think I realized when to ... the shell (such as in the $var, but also for the spaces (that ... echo "foo bar" ... you may say that $string does not appear in /list/ context so ...
    (comp.unix.shell)