Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove double quotes from a string

Tags:

string

php

This is my string:

$a='"some text';` 

How can I remove the double quote so my output will look like this?

some text` 
like image 687
maget0ron Avatar asked Aug 24 '12 14:08

maget0ron


People also ask

How do you remove double quotes from a replacement string?

Use the String. replaceAll() method to remove all double quotes from a string, e.g. str. replaceAll('"', '') . The replace() method will return a new string with all double quotes removed.

How do you remove a double string?

We can remove the duplicate characters from a string by using the simple for loop, sorting, hashing, and IndexOf() method.


1 Answers

str_replace()

echo str_replace('"', '', $a); 
like image 150
John Conde Avatar answered Sep 21 '22 14:09

John Conde