Get text in quotes

前端 未结 3 1981
猫巷女王i
猫巷女王i 2020-12-11 10:53

is there is some function that can take just text inside the quotes from the variable?
Just like:

$text = \'I am \"pro\"\';
echo just_text_in_quotes($t         


        
3条回答
  •  無奈伤痛
    2020-12-11 11:04

    This regex:

    "(\w*)"
    

    will help you as you can see here: http://rubular.com/r/3kgH7NdtLm

提交回复
热议问题