PHP 21
Starts with Guest on 15th April 2020 04:42:19 AM
  1. <?php
  2.  
  3. function startsWith($string, $startString) {
  4.   $len = strlen($startString);
  5.   return (substr($string, 0, $len) === $startString);
  6. }
  7.  
  8. // usage
  9. echo startsWith("cat", "c"); // true
  10. echo startsWith("dog", "x"); // false
  11.  
  12. ?>

PasteBin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Lars Jansen Internet Consulting
Need some advise before starting your online business strategy or project?
Get in touch!
Cleanse Your CSS!
On average, about 35% of CSS code is completely unnecessary. We meticulously find and remove this unnecessary CSS code.
Raw Paste

Login or Register to edit or fork this paste. It's free.