How to remove quotes in PHP?

Member

ryan.murray

by ryan.murray, in category: PHP General , 4 months ago

How to remove quotes in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by darion , 3 months ago

@ryan.murray as a solution you can use str_replace() function to remove quotes from any string in PHP:


1
2
3
4
5
6
7
8
<?php

$str = 'How to "remove quotes" in PHP?';

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

// Output: How to remove quotes in PHP?
echo $str;