im trying to remove the blank characters (they look like a the space key has been spammed - for about 1 - 2 lines) This is my function
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://google.com/a-good-coffee");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
//sleep(6);
curl_setopt($ch, CURLOPT_POSTFIELDS, "blablabla123abc");
$func = curl_exec($ch);
//$func will return this :
//{ "id": "great_coffee", "object": "amazing", "buff": google }
$data = json_decode($func);
echo $rem = $data-id;
//every time if after the $func is being used the id randomizes
//great_coffee will be good_things
//im okay with that but actually
//good_things will have a lot of white lines, blank characters (it looks like a lot of space has been spammed for about 1-2 lines)
The output for $rem is good_things "
It has a lot of spacing so i tried str_replace and preg_replace but they had no effect.
also there is no " in the $rem output, i just added it so i can demonstrate how much whitespace is here
expected output:good_things