str_replace on variable for $post->post_title
-
I currently have ‘front-end’ delete links on my blog for logged in Administrators with a double javascript check popup.
In the popup I’ve got the post title coming up. It works fine if I have an apostrophe in the title, but not if I have speechmarks / quotation marks
I’m currently using the following:
$variable = $post->post_title; $variable = str_replace(array("'",""), "\'", $variable);
Adding the following to cater for speechmarks does not work:
$variable = str_replace(array('"',''), '\\"', $variable);
Can anyone help me please?
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘str_replace on variable for $post->post_title’ is closed to new replies.