public static function extractSheetTitle($pRange, $returnRange = false)
    {
        // Sheet title included?
        if (($sep = strpos($pRange, '!')) === false) {
            return '';
        }

        if ($returnRange) {
            return array(trim(substr($pRange, 0, $sep), "'"), substr($pRange, $sep + 1));
        }

        return substr($pRange, $sep + 1);
    }
public static function extractSheetTitle($pRange, $returnRange = false)
    {
        // Sheet title included?
        if (($sep = strpos($pRange, '!')) === false) {
            return '';
        }

        if ($returnRange) {
            return array(trim(substr($pRange, 0, $sep), "'"), substr($pRange, $sep + 1));
        }

        return substr($pRange, $sep + 1);
    }
public static function extractSheetTitle ( $ pRange , $ returnRange = false ) { // Sheet title included? if ( ( $ sep = strpos ( $ pRange , '!' ) ) === false ) { return '' ; } if ( $ returnRange ) { return array ( trim ( substr ( $ pRange , 0 , $ sep ) , "'" ) , substr ( $ pRange , $ sep + 1 ) ) ; } return substr ( $ pRange , $ sep + 1 ) ; }
Extract worksheet title from range.

Example: extractSheetTitle("testSheet!A1") ==> 'A1'
Example: extractSheetTitle("'testSheet 1'!A1", true) ==> array('testSheet 1', 'A1');

@param string $pRange    Range to extract title from
@param bool $returnRange    Return range? (see example)
@return mixed
Extract worksheet title from range .