3v4l.org

run code in 300+ PHP versions simultaneously
<?php $adres = "pl/blog/2016/11/08/raiffeisen-polbank-mobilny-portfel/"; echo $adres; if(strstr($adres, "blog")!=FALSE){ $url=explode("/", $adres); $size=count($url); echo "\n"; $goto = $url[$size-2]; echo $goto; header("Location: /$goto"); }
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
pl/blog/2016/11/08/raiffeisen-polbank-mobilny-portfel/ raiffeisen-polbank-mobilny-portfel Warning: Cannot modify header information - headers already sent by (output started at /in/RQju5:3) in /in/RQju5 on line 10

preferences:
115.28 ms | 404 KiB | 175 Q