title: php parse_url reverse -- parsed url
body: <p>Is there a way to reverse the url from a parsed url?</p>
  
  <pre><code>$url = 'http://www.domain.com/dir/index.php?query=blabla#more_bla';
  $parse = parse_url($url);
  print_r($parse);
  /*
  array(
   'scheme'=&gt;'http://',
   etc....
  )
  */
  $revere = reverse_url($parse); // probably does not exist but u get the point
  
  echo $reverse;
  //outputs:// "http://www.domain.com/dir/index.php?query=blabla#more_bla"
  </code></pre>
  
  <p>Or if there is a way validate a url that is missing part of its recommended urls e.g </p>
  
  <p><code>www.mydomain.com</code></p>
  
  <p><code>mydomain.com</code></p>
  
  <p>should all return 
  <code>http://www.mydomain.com</code>
  or with correct sub domain</p>