before_last_bar

Remove last item on a pipe-delimited string.

Description

before_last_bar( $string ); 

Parameters (1)

0. $string
The string.

Usage

  1. if ( !function_exists( 'before_last_bar' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-l10n.php'; 
  3.  
  4. // The string. 
  5. $string = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = before_last_bar($string); 
  9.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-l10n.php  
  1. function before_last_bar( $string ) { 
  2. $last_bar = strrpos( $string, '|' ); 
  3. if ( false == $last_bar ) 
  4. return $string; 
  5. else 
  6. return substr( $string, 0, $last_bar );