I\'m doing a bookmarking system and looking for the fastest (easiest) way to retrieve a page\'s title with PHP.
It would be nice to have something like $title
Regex?
Use cURL to get the $htmlSource variable's contents.
preg_match('/(.*)<\/title>/iU', $htmlSource, $titleMatches);
print_r($titleMatches);
see what you have in that array.
Most people say for HTML traversing though you should use a parser as regexs can be unreliable.
The other answers provide more detail :)