Page 1 of 1

append apostrophe with the text and save it in xml file

Posted: Wed Jul 14, 2010 6:17 am
by periyasamy
I have to append apostrophe with the name as (Album's) and store as it is in the XML file and then i have to display that as
Album's in the page.

i have written as,

<?php
$text = "album's";
echo $dest_name = xmlspecialchars($text);
function xmlspecialchars($text) {
return str_replace(''', '&apos;', htmlspecialchars($text));
}
?>

in xml save as (album\'s)
while fetching the name from the xml it displays as album\'s

Please anyone help to fix this issue.
Thanks

Re: append apostrophe with the text and save it in xml file

Posted: Wed Jul 14, 2010 6:32 am
by pbs
Use stripslashes()

Re: append apostrophe with the text and save it in xml file

Posted: Thu Jul 15, 2010 1:20 am
by periyasamy
it's Working now , thank u