7
7
7soten2017-08-24 22:54:53
PHP
7soten, 2017-08-24 22:54:53

Replacing double quotes with regular expression in PHP?

Hello!
Please tell me how to remove double quotes from a string like:;
"History of SE "Blago" in pictures"; that is, what would happen
; "History of GP Blago in pictures";
I know that a regular expression can help, but I can't compose. Is this even possible, who knows? I will be very grateful !

Answer the question

In order to leave comments, you need to log in

3 answer(s)
W
Weridy, 2017-08-24
@7soten

Replace('"', '') and then '"'+ your string+'"'

J
Jedi, 2017-08-24
@PHPjedi

str_replace('"', '', "История ГОПНИКА "Благо" в картинках");

More about GP , friends
The str_replace function will help you!
The first argument is the desired value
The second argument is the replacement value (what the found value will be changed to)
And the last argument is the string or array in which the search and replacement are performed

O
Oleg Batishchev, 2017-10-28
@z0rg

You should not remove the quotes, but escape them
. Depending on where it is used, you need either double quotes "" or \" (escaping with a slash)
There are functions for escaping everywhere.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question