Posted By

satie83 on 03/31/12


Tagged

php strings


Versions (?)

PHP - Function endswith


 / Published in: PHP
 

This function checks if the $stringComplete variable ends with the string $endString.

  1. function endsWith($stringComplete, $endString)
  2. {
  3. $length = strlen($endString);
  4. $start = $length * -1; //negative
  5. return (substr($stringComplete, $start) === $endString);
  6. }

Report this snippet  

You need to login to post a comment.