This is the code I currently have:
<?php
echo file_get_contents("http://example.com/bin/serp.php?engine=google&phrase=stackoverflow&format=ARRAY");
?>
It is displaying this on my page:
Array
(
[0] => Array
(
[idx] => 0
[title] => Stack Overflow
[description] => A language-independent collaboratively edited question and answer site for programmers.
[url] => http://stackoverflow.com/
)
[1] => Array
(
[idx] => 1
[title] => Stack Overflow - Wikipedia, the free encyclopedia
[description] => Stack Overflow website logo.png · Stack Overflow.png. Screenshot of Stack Overflow as of December 2011. Web address · stackoverflow.com. Commercial? Yes.
[url] => http://en.wikipedia.org/wiki/Stack_Overflow
)
)
What do I need to change to have it displayed like this instead?
1. <a href="http://stackoverflow.com/">Stack Overflow</a>
A language-independent collaboratively edited question and answer site for programmers.
2. <a href="http://en.wikipedia.org/wiki/Stack_Overflow">Stack Overflow - Wikipedia, the free encyclopedia</a>
Stack Overflow website logo.png · Stack Overflow.png. Screenshot of Stack Overflow as of December 2011. Web address · stackoverflow.com. Commercial? Yes.
Any help with this would be highly appreciated.
$result = file_get_contents(.....); foreach($result as $value) { do something with $value }