3v4l.org

run code in 300+ PHP versions simultaneously
<?php $basePath = "images/bin/channels/"; $noImageNegative = "images/bin/channels/nochan_neg.png"; $noImageTribune = "http://aiotv.tmsimg.com/sources/generic/generic_sources_h3.png"; $path = "http://aiotv.tmsimg.com/sources/h3/NowShowing/21633/s21633_h3_aa.png"; if($path == $noImageTribune){ $newPath = $noImageNegative; } else { $fileName = pathinfo($path,PATHINFO_FILENAME); $negName = $fileName . "_neg.png"; $newPath = $basePath . $negName; } print $newPath;

preferences:
26.77 ms | 402 KiB | 5 Q