I'm using str_replace for a template I'm trying to use. Sometimes I need the value to be all uppercased, uppercased words etc on the template. All the post values are lowercased.
Is there a way I can apply the strtolower,strtoupper etc functions into my template?
Here's an example:
<?php
//TEMPLATE.PHP
//Let's say the post value is "john" and "math".
//I want to be able to output the following case possiblities based on the template.
//My name is JOHN and I love math class.
//or
//My name is John and I love MATH class.
$gallery_page_gallery_index="My name is %name% and I love %class% class.";
?>
$temp_index = str_replace("%name%", $_POST[name], $temp_index);
$temp_index = str_replace("%class%", $_POST[class], $temp_index);
The only thing I can think of is to do this but it would be too much:
$temp_index = str_replace("%name_ucf%", ucfirst($_POST[name]), $temp_index);
$temp_index = str_replace("%name_ucw%", ucwords($_POST[name]), $temp_index);
etc...