PHP String sscanf() Function4 Sept 2024 | 2 min read The sscanf() is predefined PHP function. It is used to return parses input from a string according to a format. If we will pass two parameters in the function, the data will be returned as an array. Related Function:
Syntax:
Example 1Output: int(7) Example 2Output: int(18) int(6) Example 3Output: string(10) "javatpoint" Example 4Output: Array ( [0] => We [1] => are [2] => Learning [3] => PHP [4] => 7 ) Next TopicPHP String |
PHP Function The function is predefined function of PHP. It is used to reverse a string. It is one of the most basic string operations which are used by programmers and developers. Syntax: string strrev ( string $string ); Parameter Description Required/Optional String Specify the string to reverse Required Example 1 <?php $var1="Hello PHP"; ...
1 min read
PHP soundex() function PHP soundex() function is used to calculate the soundex key of a string. Its key has property and can be used to search in database where pronunciation is known but not the spelling. Soundex function is described by Donald Knuth. Syntax: soundex(string); Parameter Description Required/Optional String Specify the string to check Required. Example 1 <?php $str...
1 min read
PHP String Function The string function is an in-built function of PHP. It is used to wrap a string to the given number of characters using a string break character. PHP 4.0.2 and above versions support this function. In simple words, it wraps a string...
3 min read
PHP string function PHP string '' is in-built PHP function. It is used to format a number with grouped thousands. It supports one, two or three parameters (not three). Syntax: number_format(number,decimals,decimalpoint,separator) Parameter Description Required/Optional number The number being formatted. Required decimal Set the number of decimal point. Optional decimalpoint Sets the separator for the decimal point. Optional separator Set the thousand separator Optional Example...
1 min read
PHP Function PHP function is used to convert a string hexadecimal value to ASCII ccharacters. Note: This function does not convert a hexadecimal number to a binary number. Syntax: string hex2bin ( string $data ) Parameter Description Required/Optional String Specify the hexadecimal value to be converted. required Example 1 <?php echo hex2bin("48656c6c6f20576f726c6421"); ?> Output: Hello World! Example 2 <?php $hex = hex2bin("6578616d706c65206865782064617461"); var_dump($hex); ?> Output: string(16) "example...
1 min read
PHP String Function PHP string is predefine function which is used to insert HTML line break before all newlines in a string. It returns string with <br \> or <br> before all newlines (\r\n, \n\r, \n and \r). Syntax: nl2br(string,xhtml); Parameter Description Required/Optional String Specify input string required xhtml Boolean value, whether to use XHTML...
1 min read
PHP Function The function is used to remove whitespace or other predefined character from the right end of a string. Syntax: chop(string,charlist); Note: function is different than the Perl function function, which is used to remove the last character in the string. Parameter Description Required/Optional string the string to be check Required charlist charlist...
1 min read
PHP Function PHP function is used to add quote string with slashes in a C style. It is case-sensitive Syntax: string addcslashes ( string $str , string $charlist ) Parameter Description Required/Optional String String to be esxaped Required Character Character or range to be escaped. Required Example 1 <?php $str="Welcome to JavaTpoint"; echo "Your String : ".$str; echo "<br>"."By using ''...
1 min read
PHP String function The is an in-built function of PHP which is used to find the position of the last occurrence of a substring inside another string. It is a case-sensitive function of PHP, which means it treats uppercase and lowercase characters differently. The is...
4 min read
PHP Function The is predefine function of PHP. It is used to find the position of the first occurrence of a string inside another string. Note: This function is case-insensitive and binary safe. Syntax: stripos(string,find,start); Parameter Description Required/Optional string Specify the string to search. Required. find Specify he string to find. Required. start Specify where to begin the search. Optional. Example...
1 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India