Blog

Newest Post
Blog Archives
Blog Categories

Portfolio

3D Models
Banners
Brochures
Business Cards
Custom Programming
Environments
Flash Projects
Game Design
Image Altering
Web Design

About

Resume
Recommendation Letters

Contact

November 22, 2007

Character Replace within a String using PHP

Filed under: PHP — admin @ 12:45 pm

Replacing a character within a string is easy and very useful. The only problem is I have the hardest time remembering the syntax so I figured I would post it here.

$string = 'test-data';
 
//Remove the "-" and replace it with a space
$new_string = str_replace('-',' ', $string );
 
echo $new_string; //test data

Leave a Reply

© - Digital Epiphany Designs, Online Portfolio for Web Design, Custom Programming, Grapic Design and Game Design.