PHP If You Pass Substr() Negative Number, It Counts From End Of String. – String Function

<?php
$test = "this is a test.";
if ( $test = substr( $test, -3 ) == "est") {
  print "est";
} else {
  print "Welcome to our shop!";
}
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.