paulmo Posted February 9, 2009 Share Posted February 9, 2009 well, i thought i had this figured out...does $template represent data that would be in a database table, but isn't as it's included now in application file? i'm matching submitted form text against mysql table rows. the replace arrays would not be static with predetermined values: they come from form. $template = "Cars get us from place to place. The {temp_car} is a good car, {temp_name}. You should drive it."; $place_holder_array = array(); $place_holder_array[0] = "{temp_car}"; $place_holder_array[1] = "{temp_name}"; $replace_array = array(); $replace_array[0] = "Camry"; $replace_array[1] = "Jim"; $content = str_ireplace($place_holder_array, $replace_array, $template); Link to comment https://forums.phpfreaks.com/topic/144524-template-redux/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.