You appear to be a bot. Output may be restricted
Description
Determine the reference_type from PHP tokensAttempt to determine what sort of API this is using token_get_all()
Usage
$string = oikai_determine_from_tokens( $string );
Parameters
- $string
- ( string ) required – the "api" name
Returns
string the reference type determined from token_name()Source
File name: oik-shortcodes/shortcodes/oik-api.phpLines:
1 to 16 of 16
function oikai_determine_from_tokens( $string ) { $reference_type = null; $tokens = token_get_all( "<?php $string" ); $token = array_shift( $tokens ); while ( $token ) { $token = array_shift( $tokens ); if ( is_array( $token ) ) { //print_r( $token ); $token_name = token_name( $token[0] ); //$reference_type = _oikai_determine_reference_type( $ $reference_type = $token_name; $token = null; } } return( $reference_type ); }View on GitHub