function htmlentities()
Posted: Sat Jun 30, 2007 2:16 am
feyd | Please use
The output of the code is:
Thanks,
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I work with a ubuntu system and php 5.2.1.
The next code doesn't convert special characters and html codes to entities!Code: Select all
<html>
<head>
<title>Text including html</title>
</head>
<body>
<?php
echo phpinfo();
$str= <<<TEXT
Einstürzende Neubauten and Marya's & <br>Mother and again "test".
TEXT;
$code=htmlentities($str, ENT_QUOTES);
$code1=htmlspecialchars($str);
echo $code,"<br>",$code1;
?>
</body>
</html>Could you tell me why my code doesn't work?Einstürzende Neubauten and Marya's & <br>Mother and again "test".
Einstürzende Neubauten and Marya's & <br>Mother and again "test".
Thanks,
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]