PDA

View Full Version : Search and Print


Saj
05-25-2003, 07:20 PM
Hi.

How would I tell PHP to search in a file for information between two comments, <!-- Begin --> and <!-- End -->, and that echo that information? I know how I could do the first characters of the file, but the problem with that is that this information might be in the middle or end of the document.

Thanks

Spookster
05-25-2003, 07:33 PM
Use the string functions.

http://us4.php.net/manual/en/function.stripos.php

You can use that one to find the position of the patterns <!-- Begin --> and <!-- End --> and then use one of the other string functions to return what's in between.

STDestiny
05-26-2003, 01:11 AM
Or just search hotscripts.com or scriptsearch.com for "Print version" or something like that. There are plenty of php scripts that do just what you want.

Saj
05-27-2003, 02:35 AM
Thanks! Got it to work. Thanks for your help.