RE: [PHP] Trouble wirh < in a string
> I have a small problem a string I have for example : $myvar= "hell friend"; > When I display the content of $myvar with echo I see "hell" and not the > rest. > > I suppose the problem come from the < how solve the problem ? You're putting that string in HTML and it's being evaluated by the browser. It sees the < as the beginning of a tag, so it's looking for a tag to follow. Tags that the browser doesn't recognize are just not shown. Try to put in your HTML and it won't show up (may depend on browser). What you want to do is use an HTML entity for the <, > and other characters. < would be <, > is >. You can also use the htmlentities() or htmlspecialchars() function in PHP to do the conversion for you automatically. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Trouble wirh < in a string
Try $myvar = 'hell<o my friend'; or $myvar = htmlentities("hell -Original Message- > From: Christian Ista [mailto:[EMAIL PROTECTED]] > Sent: Friday, October 11, 2002 12:56 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Trouble wirh < in a string > > > Hello, > > I have a small problem a string I have for example : $myvar= "hell friend"; > When I display the content of $myvar with echo I see "hell" and not the > rest. > > I suppose the problem come from the < how solve the problem ? > > Bye > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Trouble wirh < in a string
Hello, I have a small problem a string I have for example : $myvar= "hellhttp://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php