Re: CREATING A FILE with a TEMPLATE
| From: | Marco Tabini | Date: | Thu, 17 Oct 2002 15:03:03 +0000 |
| Subject: | Re: CREATING A FILE with a TEMPLATE | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120342@lists.php.net to get a copy of this message | ||
Try using explode:
$data = explode ('##', $template);
$result = '';
for ($i = 0; $i < count ($data); $i++)
$s .= ($i % 2) ? $($data[$i]) : $data[$i];
I'm not sure that this works 100% because I'm doing it from memory, but
hopefully it should put you on the right track.
On Thu, 2002-10-17 at 10:35, Kevin Fradkin wrote:
> Hi, i would like to know if someone can help me....
> my little problem is :
> i have a template and i want that every form filled on my website replace
> on my template ( where i put ##var01## ##var02## etc) and with that create a
> new file with the results...
>
> i just need how to read from that template all the code, copy it to the new
> file and replace the ##vars## with the $vars of the form
>
> If there is a kind soul who can help me...
>
> Thankyou! VM!..
>
> Spooky
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>