3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $imageURL = "http://images.moneysavingexpert.com/images/warmth-alerts-illustrations.png"; $parts = parse_url($imageURL); $path = $parts['path']; $lastSlash = strrpos($path,"/"); $lastSlash++; $imageName = substr($path, $lastSlash); echo "<pre>"; print_r($parts); print_r($imageName);
based on oXJh7
Output for 4.3.0 - 7.3.0rc4
<pre>Array ( [scheme] => http [host] => images.moneysavingexpert.com [path] => /images/warmth-alerts-illustrations.png ) warmth-alerts-illustrations.png