i have an url <img src="http://gebhart.dk/gdk15/wp-content/uploads/2015/02/3023.jpg">
but i need "2015/02/3023.jpg"
this is not working: $value is the url
print_r(parse_url($value));
$tokens = explode('/', $value);
echo $tokens[sizeof($tokens)-3];
or
parse_url($value);
but then i get <img src="/gdk15/wp-content/uploads/2015/02/3023.jpg">
how can i get the url form the img src minus 2 folders?
Quick and dirty:
$relurl=explode('/', $value);
$relurl=array_slice($relurl, -3);
echo implode('/', $relurl);