I have this javascript array
[
"spiderman",
"xmen",
"barbie",
"avengers"
]
It is what I see on the screen when I open http://localhost:8080
If I decide to show it in laravel using this code in a controller :
public function showReccPosts(){
$name='alice';
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, [
CURLOPT_URL => "http://localhost:8080/?name=$name",
CURLOPT_PROXY => '',
]);
// Send the request & save response to $resp
$results = curl_exec($curl);
// Close request to clear up some resources
curl_close($curl);
return view('reccomended.index',compact('results'));
}
}
And in a blade file:
{{$results
I get:
[
"spiderman",
"xmen",
"barbie",
"avengers"
]1
What is up with the 1 attached at the end of the array? Will it stop me from from performing functions on the array? By the way,can I even use that type of array (from js to php)?