wp_endswith

The Jetpack by WordPress.com wp endswith function.

Description

wp_endswith( $haystack, $needle ); 

Parameters (2)

0. $haystack
The haystack.
1. $needle
The needle.

Usage

  1. if ( !function_exists( 'wp_endswith' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/functions.compat.php'; 
  3.  
  4. // The haystack. 
  5. $haystack = null; 
  6.  
  7. // The needle. 
  8. $needle = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wp_endswith($haystack, $needle); 
  12.  

Defined (1)

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

/functions.compat.php  
  1. function wp_endswith( $haystack, $needle ) { 
  2. return $needle === substr( $haystack, -strlen( $needle ));