Find us on twitterLike us on facebook
View Portfolio

PHP Library

Support Us

CSS Library

Replace words using php - Replace the characters | DevSocial.net Replace words using php - Replace the characters | DevSocial.net

free php scripts



Listings

Replace words using php - Replace the characters

Replace words using php - Replace the characters

PHP str_replace() Function

Replace the characters "world" in the string "Hello world!" with "Peter":

<?php 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) 



Views: 9,910 / Downloads: 142 | Price: $0 | PHP / PHP Functions
Status:

|

You have no Listings. Create Listing.


Buy Ready made Web Apps  Buy Ready made Web Apps


Website Ranking Tools

classifieds24.net classifieds24.info classifieds24.org nywds.com https://www.globalclassifieds.org/ domainpaid.net devsocial.net paystopost.com paystopost.org https://www.101now.com https://www.newyorkconstructionco.com paystopost.org https://www.hirepros.org https://www.hirepros.info
EST: 2012 | © 2025 Devsocial.net | All Rights Reserved. [ + ][ y ]
SHARE:

Facebook

Twitter