Replace double quote in single quote

688 views Asked by At

If I use a double quote in title of my application i have a problem , then I want to create a condition :

if i have double quote , use single quote .

Thanks you very much !

2

There are 2 answers

0
Deep Kakkar On

You can use the str_replace() following :

str_replace('"', "'", $text);

str_replace

0
thewildandy On

You haven't provided much context for your question so it's difficult to know exactly how to help, but lets say you have a variable called $title with double quotes in it, you can replace them like this:

$title = str_replace('"', "'", $title);