php help
php help
Out of context: Reply #9
- Started
- Last post
- 16 Responses
- unfittoprint0
use the folowing method.
create dynamic tags like ::name::', '::country::', etc... within your text files.
create an array of variables like
$name - > 'John', $country - > 'Portugal'after reading the contents of the txt file using fopen and storing it in a variable [$var] using fread u then proceed to use a foreach loop using that array and to str_replace every '::'.$key.'::' it finds with the content $var.
to, well, replace '::'.$key.'::'
use a str_treplace