Removing double quotes from beginning and end of String

前端 未结 2 1014
北荒
北荒 2020-12-20 23:23

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

相关标签:
2条回答
  • 2020-12-20 23:49

    Use the trim function:

    $str = '"Hello"';
    echo trim($str, '"'); // Outputs Hello
    
    0 讨论(0)
  • 2020-12-20 23:50

    Trim is your friend:

    trim($string,'"');
    
    0 讨论(0)
提交回复
热议问题