PHP strrchr() Function4 Sept 2024 | 1 min read The strrchr() function in inbuilt function of PHP. It is used to find the position of the last occurrence of a string. This function returns all characters from this position to the end of the string or FALSE if the character is not found. Note: The strrchr() function is binary-safe.Syntax:
Example 1Output: Your first string is:Hello PHP Your second string is:PHP By using 'strrchr()' function:P Example 2Output: Your string is:We are Learning PHP By using 'strrchr()' function:arning PH Example 3Output: Your string is:Hello PHP By using 'strrchr()' function:ello PHP See Also:strncmp() : String comparison of the first n characters (case-sensitive) strpbrk() : Searches a string for any of a set of characters strpos() :Returns the position of the first occurrence of a string inside another string (case-sensitive) Refererence: http://php.net/manual/en/function.strrchr.phpNext TopicPHP String |
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 String Function The 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: print(): It is used for output...
1 min read
PHP String Function The function is the in-built function of PHP. It is used to get numeric information. This function returns an array which contains local numeric and monetary formatting information. This function is a non-parameterized function, so we do not need to pass anything...
5 min read
PHP Function PHP function is string function, which is used to convert character to HTML entities. Syntax: htmlentities(string,flags,character-set,double_encode); Parameter Description Required/Optional String Specify the string to convert. required flags Specify how to manage quotes, invalid encoding. optional Character Specify the character set optional Double_encode Specify a Boolean value. optional Example 1 <?php $str = '<a href="https://www.javatpoint.com">Go to javatpoint.com</a>'; echo htmlentities($str); ?> Output: Go to javatpoint.com Example 2 <?php $str = "Hello PHP...
1 min read
PHP String function The is an in-built function of PHP, which is used to replace a substring inside the other string. It provides the facility to change the particular word in a string. The function translates characters or replaces the substrings. It is a...
3 min read
PHP Hebrev() Function PHP is string function, which is used to convert Hebrew text from right to left or left to right visual text. Syntax: hebrev(string,maxcharline) ; Parameter Description Required/Optional string A Hebrew text. required maxcharline Specify maximum character for each line. optional Example 1 <?php echo hebrev("? ???? ?????"); ?> Output: ??????? ?????? ??? TopicPHP String ...
1 min read
PHP String Function The is a built-in function of PHP, which is used to convert/transform a formatted string to a specific output stream. In , the arguments are placed in an array. The elements of the array will be inserted along with percent (%) signs...
3 min read
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 str_replace() function The str_replace() function is a case-sensitive, built-in function of PHP which replaces some character of the string with other characters. It is used to replace all the occurrences of the search string with the replacement string. Syntax The syntax of the str_replace() function is given below,...
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
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