How can I replace ""
(I think it's called double quotes) with ''
(I think its called single quotes) using PHP?
To remove double quotes just from the beginning and end of the String, we can use a more specific regular expression: String result = input. replaceAll("^\"|\"$", ""); After executing this example, occurrences of double quotes at the beginning or at end of the String will be replaced by empty strings.
On the keyboard You can make single quotation marks on most computers by pressing the apostrophe/quotation mark key to the left of ENTER. Double quotation marks are made on most computers by holding SHIFT and pressing the apostrophe/quotation mark key to the left of ENTER.
If you are an American, using quotation marks could hardly be simpler: Use double quotation marks at all times unless quoting something within a quotation, when you use single. It's different in the greater Anglosphere, where they generally use singles in books and doubles in newspapers.
str_replace('"', "'", $text);
or Re-assign it
$text = str_replace('"', "'", $text);
Use
$str = str_replace('"','\'',$str)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With