champoi Posted December 13, 2008 Share Posted December 13, 2008 are there codes that can read every character stored in a variable, and even be able to replace them with other characters? example: i have this variable, $text = abcdefgh; and i want to replace a with b, so it becomes like this, $text = bbcdefgh; are there ways of doing this? Link to comment https://forums.phpfreaks.com/topic/136809-solved-question/ Share on other sites More sharing options...
T Horton Posted December 13, 2008 Share Posted December 13, 2008 Hi You would need to use: $text = "abcdefgh"; $newtext = str_replace("a", "b", $text); echo "Before: " .$text ."<BR>"; echo "After: " .$newtext; Hope this helps Tom Link to comment https://forums.phpfreaks.com/topic/136809-solved-question/#findComment-714497 Share on other sites More sharing options...
champoi Posted December 13, 2008 Author Share Posted December 13, 2008 thnx Link to comment https://forums.phpfreaks.com/topic/136809-solved-question/#findComment-714505 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.