-1
$title=$movieArray['title'];
echo $title;

The value of the string after echo out is "Sherlock". How to remove the quotation marks of a string to become Sherlock

  • jsut use this `substr($title,1,-1)` – Maraboc Jul 12 '17 at 07:55
  • 4
    Possible duplicate of [Delete first character and last character from String PHP](https://stackoverflow.com/questions/7045618/delete-first-character-and-last-character-from-string-php) – Maraboc Jul 12 '17 at 07:56
  • `echo trim($title, '"');` – Jared Chu Jul 12 '17 at 07:57
  • Maybe you should consider stripping it before it goes into the database, stripping it out everytime is inefficient. – Ian Jul 12 '17 at 07:59
  • I would first check the reason why you're getting that in the first place, it might indicate that something else has gone wrong. – apokryfos Jul 12 '17 at 08:00

2 Answers2

0

You can use str_replace() for this.

$title = str_replace('"', '', $movieArray['title']);

Replaces the "-Quotationmark

Bernhard
  • 1,852
  • 11
  • 19
0
$title=$movieArray['title'];

$title = trim($title,'"');

echo $title;
Hariharan
  • 1,174
  • 2
  • 12
  • 17