var element = document.getElementByName(‘element-name’);
But, this is for all those smart people who love jQuery and want to easily select and process anything in their coding, like…
var elements = $(‘element-name’);
I do not want to explain everything that jQuery does for us. While writing this post I assume that everyone knows how to write jQuery.
So, the question is… Is there anything similar like this in PHP where we can pass document HTML and select and process elements. Then, you have heard it right, yes its called PHPQuery and its awesomely easy to integrate it into our PHP coding.
Its just a simple PHP class. Include it once in your code and use it just like jQuery.
Download it here, https://code.google.com/p/phpquery/
To use, just load the html using class’ function and use pq() just like you use $() for jQuery. More information can be found here. https://code.google.com/p/phpquery/wiki/Basics