Answer the question
In order to leave comments, you need to log in
How to competently replace a character using preg_replace?
INSERT INTO "accounts_order"("id","name","email","address","phone","comment","retail_price","wholesale_price","retail_price_with_discount","status","created_at","updated_at","user_id","guid") VALUES ( 3,' Имя','[email protected]','12мк','+12345667',"Comment",'31582','18160','31582','success','2015-09-30 09:32:56.495034','2015-09-30 11:04:49.227136',1,'3b5a4db4-6756-11e5-a891-9' );
Answer the question
In order to leave comments, you need to log in
some nonsense but:
preg_match("/INSERT INTO(.*?)VALUES/ism", $text, $match)
Теперь замените в match все нужные кавычки на одинарные а потом сделайте str_perlace в главной строке и всё.
Are you sure that you are not fighting the symptoms instead of treating the disease? Because if you need to replace something in SQL queries using regular expressions, it is most likely better to rewrite their construction.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question