![]() |
The token_name() function is an inbuilt function in PHP that is used to retrieve the textual representation of a given token identifier. In PHP, when you write code, it gets parsed into a series of tokens, which are the basic units of code that the interpreter understands. These tokens include keywords, operators, constants, variables, and other elements of the code. Syntax: string token_name(int $token)
Parameters: This function accepts only one parameter which is described below.
Return Value: The token_name() function returns the symbolic name of the given token. Program 1: The following program demonstrates the token_name() function. PHP
Output
Token name for 322: T_IF Program 2: The following program demonstrates the token_name() function. PHP
Output
Token name for 322: T_IF Token name for 324: T_ECHO Token name for 330: T_FOREACH Reference: https://www.php.net/manual/en/function.token-name.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 14 |