At least in php 5.6.x this function does appear to work with relative URLs despite what it says above.
Learn more or connect with us: *Imagely Website *Genesis Word Press Themes for Photographers *Managed Word Press Hosting for Photographers *The Word Press Photography Podcast *Next GEN Gallery Documentation *Imagely on Twitter *Imagely on Facebook *Imagely on Instagram Copyright: Imagely 2016 Photocrati Media 2012-2016 Alex Rabe 2007-2011 This program is free software.
I was writing unit tests and needed to cause this function to kick out an error and return FALSE in order to test a specific execution path.
If anyone else needs to force a failure, the following inputs will work: @ solenoid: Your code was very helpful, but it fails when the current URL has no query string (it appends '&' instead of '? Below is a fixed version that catches this edge case and corrects it.
At the first line there was parse_query($val), I made it $var. This is useful if something like below is done: When using the url /* line too long for this site's comment handler */ "foo://username:[email protected][2060:01::68]:8042". name=ferret#nose"The original would return Array( [scheme] = parse_url doesn't works if the protocol doesn't specified.
This seems like sandard, even the youtube doesn't gives the protocol name when generates code for embedding which have a look like "//youtube.com/etc".