I have a text link
Yeast-Aid™ 200c - Hypoallergenic
I want to replace "200c" with "200 Caps" as this will be done on 20K records i want and expression to be able to replace any "c" prefixed by number with " Caps".
I use PHP.
I have a text link
Yeast-Aid™ 200c - Hypoallergenic
I want to replace "200c" with "200 Caps" as this will be done on 20K records i want and expression to be able to replace any "c" prefixed by number with " Caps".
I use PHP.
This is very basic regex substitution. Try this program out:
<?php
$string = 'Yeasties 200c - Hyperhyperhyper';
echo preg_replace('/(\d)c/i', '$1 Caps', $string);
echo "\n";
?>
preg_replace
preforms the regex substitution.
If you cannot figure out how that program works, or want a reference, try the php documentation here, preg_replace.
You really should look online for documentation first. I have never used php before (literally this is my first program with it), but I didn't find it to challenging. Perhaps the most important coding skill is being able to learn things quickly.