PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Nov 15, 2019 11:43 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Split up source
PostPosted: Tue May 10, 2005 2:55 pm 
Offline
Forum Regular
User avatar

Joined: Thu Nov 25, 2004 10:53 pm
Posts: 708
Location: U Michigan
Two regex's needed:

1. preg_split source code into an array like this:
[0] => <!DOCTYPE .....>
[1] => <html>
[2] => <head>
[3] => <title>
[4] => Acdrifter.com
[5] => </title>
[6] => </head>
[etc.......]

2. preg_math to see whether a line of that code is a tag or a content entry.
true: </head>
true: <div class="box" style="margin-top: 5px;">
etc....

[php="Attempt at figuring out if a line is a tag or not:"]
$regex = &quote;#</?\w+( ї\w-]+=\&quote;.+\&quote;)*( /)?>#&quote;;


http://www.acdrifter.com/tester.php for the progress - It shows the regex expression and the results.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 11, 2005 7:11 am 
Offline
Forum Contributor

Joined: Sat Mar 27, 2004 5:42 am
Posts: 147
Location: ManchesterUK
http://uk.php.net/manual/en/ref.simplexml.php


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group