replace string
how can I replace who string with certain beginning and ending, for example I have string:
abc........xyz
I want to replace this string with "this is a test", no matter what text in between, only "abc" and "xyz" are fixed.
abc123xyz-->this is a test
abcd1234xyz-->this is a test
any idea?
michael123
Junior Poster in Training
94 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
Simple PHP should do it if you do not know regular expressions.
$string = "abcd123xyz";
if((substr($string,0,3)=="abc") && (substr($string,-3)=="xyz"))
{
$string = "this is a test";
}
echo $string;
TopDogger
Junior Poster in Training
87 posts since Aug 2005
Reputation Points: 15
Solved Threads: 5