dexfs
5/1/2015 - 4:16 AM

anwser to question in http://stackoverflow.com/questions/29981347/how-to-return-the-full-url-before-the-hash-using-php

<?php 
#parse_url http://php.net/manual/pt_BR/function.parse-url.php
$url = 'https://www.example.com/page.php#!/more-and-more/text/that-needs-to-go/away';
print_r(parse_url($url));


#regex( preg_match ) - http://php.net/manual/pt_BR/function.preg-match.php
$pattern = '/.*page\.php/';
preg_match($pattern, $url, $matches);
print_r($matches);