Guest User

Untitled

a guest
May 22nd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. // We want to use the function stripos,
  2. // but thats only available since PHP5.
  3. // So we cloned the function...
  4. if(!function_exists('stripos')) {
  5. function stripos_clone($haystack, $needle, $offset=0) {
  6. return strpos(strtoupper($haystack), strtoupper($needle), $offset);
  7. }
  8. } else {
  9. // But when this is PHP5, we use the original function
  10. function stripos_clone($haystack, $needle, $offset=0) {
  11. return stripos($haystack, $needle, $offset=0);
  12. }
  13. }
Add Comment
Please, Sign In to add comment