3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n1 = 'queryselector'; $n2 = 'que'; // echo $n1, $n2; if (strpos($n1,$n2) !== '') { if (strlen($n2) > 0) { echo 'Find substring at position: ' . strpos($n1, $n2); if (substr($n1, 0, strlen($n2)) == $n2) { echo ' & is at Starting.'; } else if (substr($n1, '-'.strlen($n2)) == $n2) { echo ' & is at Ending.'; } else { echo ' & is in Between.'; } } }

preferences:
31.53 ms | 405 KiB | 5 Q