Date: 09/30/00
- Next message: Chris Hayes: "[PHP] Re: problem with image button"
- Previous message: Remco Chang: "[PHP] string concat with < and >"
- In reply to: Remco Chang: "[PHP] string concat with < and >"
- Next in thread: Remco Chang: "[PHP] accessing CONSTANTS"
- Reply: Remco Chang: "[PHP] accessing CONSTANTS"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, 30 Sep 2000, Remco Chang wrote:
> i'm having trouble concatenating strings with the characters '<' and '>'.
>
> $msg = "hello";
> $msg = "<".$msg.">";
>
> this doesn't work at all... i would like $msg to be <hello>, but i end up
> getting an empty string.
>
> neither does "<<".$msg.">>" or "\<".$msg."\>" work...
>
> i'm stumped, any ideas?
Works fine. But if you echo that to a browser, it'll parse <hello> as a
tag and display nothing. (Hint: Viewing the html source when debugging is
almost always useful)
If you want to display '<hello>' in a browser, you'd need to use < and
> instead of < and >.
$msg = 'hello';
$msg = "<$msg>";
Matt
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Chris Hayes: "[PHP] Re: problem with image button"
- Previous message: Remco Chang: "[PHP] string concat with < and >"
- In reply to: Remco Chang: "[PHP] string concat with < and >"
- Next in thread: Remco Chang: "[PHP] accessing CONSTANTS"
- Reply: Remco Chang: "[PHP] accessing CONSTANTS"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

