PHP - 从JSON响应中删除

I have a (simplified) JSON response from an API call that looks like below

{"status":true,"action_values":"{
 \"range_from\": \"0\",
 \"range_to\": \"0\"
}"}

I am trying to remove the characters from above using PHP but it doesn't seem to be working.

I try:

$trimmed = str_replace("
", "", $response);

Where $response is my JSON string as above. But this does not remove/replace the character.

查看全部
dsgoj7457
dsgoj7457
2017/11/28 12:54
  • newline
  • json
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复