fs_starts_with

Check if string starts with.

Description

fs_starts_with( (string) $haystack, (string) $needle ); 

Parameters (2)

0. $haystack (string)
The haystack.
1. $needle (string)
The needle.

Usage

  1. if ( !function_exists( 'fs_starts_with' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/freemius/includes/fs-core-functions.php'; 
  3.  
  4. // The haystack. 
  5. $haystack = ''; 
  6.  
  7. // The needle. 
  8. $needle = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = fs_starts_with($haystack, $needle); 
  12.  

Defined (1)

The function is defined in the following location(s).

/freemius/includes/fs-core-functions.php  
  1. function fs_starts_with( $haystack, $needle ) { 
  2. $length = strlen( $needle ); 
  3.  
  4. return ( substr( $haystack, 0, $length ) === $needle );