Assign Anchor IDs Using PHP
Last week, I challenged my readers to create a PHP script that finds anchors in an HTML document and assigns an ID to the element IF the element doesn't have an ID already.  Jeremy Parrish stepped up to the challenge.
The PHP
function anchor_fix($anchor)
{
  // the match comes as an array
  // the whole match (what we want) is the 0th element
  if (! preg_match('/\sid="/i', $anchor[0])) {
	 return preg_replace('/name="([^"]*)"/i', 'id="$1" $0', $anchor[0]);
  } else {
	 // already has an id!
	 return $anchor[0];
  }
}
/* usage */
echo preg_replace_callback('/<a[^>]*>/i', 'anchor_fix', file_get_contents('page.html'));
The Result
<body>
	<b>
	<a 
	name="stuff">this is an anchor</a> some text... <a name="another">another one...</a>
	</b>
	<div><a id="thing" name="other">another thing</a>
	</div>
</body>
... becomes ...
<body>
	<b>
	<a 
	id="stuff" name="stuff">this is an anchor</a> some text... <a id="another" name="another">another one...</a>
	</b>
	<div><a id="thing" name="other">another thing</a>
	</div>
</body>
Great job Jeremy!
![Responsive Images: The Ultimate Guide]() - Chances are that any Web designers using our Ghostlab browser testing app, which allows seamless testing across all devices simultaneously, will have worked with responsive design in some shape or form. And as today's websites and devices become ever more varied, a plethora of responsive images... 
![9 More Mind-Blowing WebGL Demos]() - With Firefox OS, asm.js, and the push for browser performance improvements, canvas and WebGL technologies are opening a world of possibilities.  I featured 9 Mind-Blowing Canvas Demos and then took it up a level with 9 Mind-Blowing WebGL Demos, but I want to outdo... 
![Create a Dynamic Flickr Image Search with the Dojo Toolkit]() - 
The Dojo Toolkit is a treasure chest of great JavaScript classes.  You can find basic JavaScript functionality classes for AJAX, node manipulation, animations, and the like within Dojo.  You can find elegant, functional UI widgets like DropDown Menus, tabbed interfaces, and form element replacements within... 
![Using jQuery and MooTools Together]() - There's yet another reason to master more than one JavaScript library:  you can use some of them together!  Since MooTools is prototype-based and jQuery is not, jQuery and MooTools may be used together on the same page.
The XHTML and JavaScript
jQuery is namespaced so the...