append apostrophe with the text and save it in xml file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
periyasamy
Forum Newbie
Posts: 5
Joined: Fri Jul 09, 2010 12:44 am

append apostrophe with the text and save it in xml file

Post 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
pbs
Forum Contributor
Posts: 230
Joined: Fri Nov 07, 2008 5:31 am
Location: Nashik, India
Contact:

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

Post by pbs »

Use stripslashes()
periyasamy
Forum Newbie
Posts: 5
Joined: Fri Jul 09, 2010 12:44 am

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

Post by periyasamy »

it's Working now , thank u
Post Reply