I am using str_replace to do this - -
for example
Code: Select all
$recipeingredients = str_replace(" Cups", " C.", $recipeingredients);
$recipeingredients = str_replace(" cups", " C.", $recipeingredients);
$recipeingredients = str_replace(" Cup", " C.", $recipeingredients);
$recipeingredients = str_replace(" cup", " C.", $recipeingredients);
$recipeingredients = str_replace(" c", " C.", $recipeingredients);
$recipeingredients = str_replace(" C", " C.", $recipeingredients);1 C water
will produce
1 C. water
typing
1 C. Carrots
will produce
1 C. C.arrots
Is there a way in PHP where I can essentially say "look after the 1st blank space and not after the 2nd" ??
I'm a newb... sorry if this is a ridiculous question.... I'd like to have only one text area for the entire recipe...