CodeXpress

Welcome, Guest: Join CodeXpress Log In!

Stats: 11 Members, 99 topics and 9 posts Date:  Saturday 31 October 2020 at 11:37 PM

This is a product of CodeXpress Buy License for your website

PHP 7x str_replace() Function

CodeXpress / Science/Technology / Programing / PHP 7x str_replace() Function

82 people viewed

Php 7x Str_replace() Function
(Go Down) (» Reply topic)
PHP 7x str_replace() Function by Marshallunduemi(): Wed 22, April, 2020
The str_replace() function replaces some characters with some other characters in a string. This function works by the following rules: If the string to be searched is "Hello World!", find the value "world" and replace it with "Peter":


echo str_replace("world","Peter","Hello world!");
?>


Definition and Usage

The str_replace() function replaces some characters with some other characters in a string.

This function works by the following rules:

If the string to be searched is an array, it returns an array
If the string to be searched is an array, find and replace is performed with every array element
If both find and replace are arrays, and replace has fewer elements than find, an empty string will be used as replace
If find is an array and replace is a string, the replace string will be used for every find value

Note: This function is case-sensitive. Use the str_ireplace() function to perform a case-insensitive search.

Note: This function is binary-safe.
Syntax
str_replace(find,replace,string,count)

Welcome to CodeXpress Forum Script - Download NL script Free
(» Go Up)

You must Sign in or Sign Up to post content

For you to post content on this website you have to log in or register, it only take few minute to create account

Go Up

Recommended for you

Php 7x Str_replace() Function

Currently: 1 guest(s) reading this article

Developed by Codexpress Programming Labs
Post content
Powered by Marshall