your usage oh phantomjs is correct according to the documentation.
http://phantomjs.org/api/webpage/property/content.html
php exec method returns the last line only.
Maybe that line is a white space.
http://php.net/manual/fr/function.exec.php
You shall have a seond parameter &$output, sent by reference. It is an array containing the entire output.
A problem you may face later, the content could need be to evaluated before you try to read it s DOM document content. Using for example innerHTML of HTML tag, ie: $('html').html();
If the page does not have jquery, you may include it, see this example, https://github.com/ariya/phantomjs/blob/master/examples/phantomwebintro.js
Note also that google may actively desire to not let users scrap and save their search results. Not sure about that.