/ Published in: PHP
Expand |
Embed | Plain Text
function startsWith($check, $string) { if ($check === "" || $check === $string) { return true; } else { } }
Comments
Subscribe to comments
You need to login to post a comment.
function startsWith($check, $string) { if ($check === "" || $check === $string) { return true; } else { } }
Subscribe to comments
You need to login to post a comment.
Nice one.
Check this implementation here on Snipplr, which I wrote: startsWith()
And if you wanna do it with the end of a string, I don't think you can use strpos(), check this implementation, which is also written by me: endsWith()
Which is the exact reason I didn't use it for the startswith() function either.