Re: Writing to files (db related) ish
| From: | Adam Royle | Date: | Wed, 25 Sep 2002 22:00:12 +0000 |
| Subject: | Re: Writing to files (db related) ish | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-21985@lists.php.net to get a copy of this message | ||
Are you trying to implement a template based system?
If you know the line number to put it in, then you would just use some arrays and looping, etc. If
you want it in a particular place (eg. between <body> and </body>), you could use regex,
or just a simple replace.
A way I have recently done it (in ASP though) is using dreamweaver style templates.
ie:
<!-- #BeginEditable "content_1" -->this will be replaced<!-- #EndEditable -->
and used regex and other string functions to replace the information in the middle.
Hope this helps
Adam
--- Original Message ---
Hi All
I know how to open, read & write to files using Php.
But how can you write some content to a particular place in a file,
Not the start or end but say the middle some where.
Example:
Basic html file
<html>
<head>
<title></title>
</head>
<body>
Write my stuff here!!!
</body>
</html>
This eventually will relate to a db so I hope its not completely of
topic.
Sorry if it is.
Web resources, examples, tutorials gratefully received.
Thanks in advance
Dave C