PHP string str_ireplace() Function4 Sept 2024 | 1 min read PHP string str_ireplace() is predefined function. It is used to replace some character with some other characters. It is case-insensitive version of str_replace(). Note: This function is binary-safe.Syntax:
Example 1with using 'str_ireplace()' functionL:('PHP','JAVA','PYTHON','RUBY') By using 'str_ireplace()' function: PYTHON! Output: Your array string is: array('PHP','JAVA','PYTHON','RUBY') Array ( [0] => JAVA [1] => JAVA [2] => PYTHON [3] => RUBY ) Replacements: 1 Example 3Output: Before using 'str_ireplace()': array('PHP','JAVA') After using 'str_ireplace()':array('PHP','java','!') Array ( [0] => B [1] => [2] => ! ) Next TopicPHP String |
PHP Function The is predefine function of PHP. It is used to remove backslashes and clean up data retrieved from a database or from an HTML form. It returns a string with backslashes stripped off. This function is important while we need to remove the...
1 min read
PHP String Function The function converts special characters into HTML entities. It is the in-built function of PHP, which converts all pre-defined characters to the HTML entities. The pre-defined characters are: & (ampersand) converted as & " (double quote) converted as " ' (single quote) converted as...
3 min read
PHP Function The is predefined function of PHP. It is used to find the length of initial segment or returns the number of characters including whitespaces found in a string. Note: This function is binary-safe. Syntax: strcspn(string,char,start,length); Parameter Description Required/Optional String Specify the string to search. Required Char Specifies the characters to search for. Required Start Specify where...
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 string Function PHP string is predefined function. It is used to convert first byte of string to a value between 0 and 255. It returns ASCII value. Syntax: int ord ( string $string ); Parameter Description Required/Optional string Specify string value required Example 1 <?php echo "Your Value is: A"."<br>"; echo "By using '' Function:".ord("A")."<br>"; ?> Output: Your Value...
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 Function PHP function is important function, which is used to output one or more string. Note: The function is not actually a function, so there is no required to use parentheses. Syntax: int print ( string $arg ); Parameter Description Required/Optional string Specify one or more string to be sent output. Required Example...
1 min read
PHP string Function The is predefine function of PHP. It is used to repeat a string a specified number times. It returns input repeated multiple times. Syntax: tr_repeat(string,repeat); Parameter Description Required/Optional String Specify the string to repeat. Required repeat Specify the number of times for repeated. required Example 1 <?php echo "Before using '' function: ('.',13)"; echo "<br>"; echo "After using...
1 min read
String Function The is the in-built function of PHP. This function returns the translation table which is used by htmlspecialchars() and htmlentities() functions. There are several ways to encode the special characters. E.g. &quot;, &#x22;, or &#34. Syntax get_html_translation_table(table, flags, encoding) For example get_html_translation_table( [ int $table = HTML_SPECIALCHARS...
2 min read
function in PHP The is a case-insensitive, built-in function of PHP. It compares two strings for the first n characters. This function is similar to the strcasecmp() function with a difference. In , we can specify the number of characters from both the strings for...
3 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