News for hackers. Stuff that matters.
Re:URI.js is a facility for working with URLs by gog on Wednesday December 28, 2011 @05:33PM (#3401709)
I have been looking for something like this in PHP, any ideas?
Re:URI.js is a facility for working with URLs by pygorex on Wednesday December 28, 2011 @05:49PM (#3401762)
PHP's has mature URI parsing using several built-in functions that provide very similar functionality.

parse_url http://us.php.net/parse_url for getting URI components

parse_str http://us.php.net/parse_str for getting query string variables

These two functions take care of the vast majority of my URI parsing/creation tasks.

Of course it would be nice to have a fluent interface like URI.js via a PHP class. And the URI normalization functions.

Re:URI.js is a facility for working with URLs by gog on Wednesday December 28, 2011 @05:58PM (#3401792)
Tnx, I knew about those, I am currently building the fronted for the Solr powered search engine (adding/removing facets from the url) and sometimes it gets pretty messy.

I was hoping there are some existing resources before I start porting this...

Re:URI.js is a facility for working with URLs by rodneyrehm on Thursday December 29, 2011 @05:05AM (#3403145)
Funny… URI.js is more or less a port of my PHP URL class. Zend Framework has one. look at https://gist.github.com/1499238 to get you started. (Not a chainable API and not as powerful as URI.js either). The path resolving can be taken from the code I wrote for Smarty a couple of months ago: http://code.google.com/p/smarty-php/source/browse/trunk/dist... - lemme know if/when/how you're done… interested in using the PHP version myself ;)