
July 16th, 2003, 09:16 PM
|
|
Contributing User
|
|
Join Date: Oct 2002
Location: Washington, DC
Posts: 317
Time spent in forums: 2 m 3 sec
Reputation Power: 7
|
|
As the crazy one said - but also if you just need to match the [page] within the blob - don't even use the slow regex, use something like this:
PHP Code:
if ( stristr( $page_data, '[page]' ) )
{
/* true - [page] found in blob */
}
else
{
/* false - [page] not found in blob */
}
Now, you mentioned [page=something] in your post, but i don't see that in your code. If this is the case, you need to use something like this:
Code:
if ( preg_match( '/\[page=(.*?)\]/', $page_data, $match ) )
{
/* Found - the page name is held in $match[1] */
}
This brings us to the next question - will there be mulitple pages on this - if so, you need preg_split() and a preg_match_all() combination and a little helping hand on getting the array() data out of the $match array in order of page sequence...
__________________
~ Joe Penn
We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?
Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.
|