Skip to content

Instantly share code, notes, and snippets.

@notacouch
notacouch / http_build_url.php
Created October 17, 2012 20:17 — forked from MattiJarvinen-BA/http_build_url.php
PHP replacement of http_build_url (PHP PECL pecl_http >= 0.21.0)
<?php
// handy script from tycoonmaster at gmail dot com
// http://fi2.php.net/manual/en/function.http-build-url.php#96335
// I didn't make this but I think it is useful so I store / share it here
if (!function_exists('http_build_url'))
{
define('HTTP_URL_REPLACE', 1); // Replace every part of the first URL when there's one of the second URL
define('HTTP_URL_JOIN_PATH', 2); // Join relative paths
define('HTTP_URL_JOIN_QUERY', 4); // Join query strings