Jeff Davidson
Jeff Davidson

Reputation: 1929

Removing double quotes from beginning and end of String

What I'm trying to find out is which php function allows me to remove double quotes from the beginning and end of a text string if they exist

Upvotes: 5

Views: 25317

Answers (2)

Nobita
Nobita

Reputation: 23713

Trim is your friend:

trim($string,'"');

Upvotes: 6

Paul
Paul

Reputation: 141829

Use the trim function:

$str = '"Hello"';
echo trim($str, '"'); // Outputs Hello

Upvotes: 20

Related Questions