Getting some specific stuff out of a file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

hmm lets see...

Code: Select all

$yourText = '<data something="some value" somethingElse="some other value">';
$yourText = file_get_contents('someFilename.txt');
toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

Post by toasty2 »

I thought yourText was what you are looking for, not what you look in. Also, I don't understand what purpose '#\b([a-z0-9]+)\s*=\s*(["\'])(.*?)\\2#is' has.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It's called a pattern. The function runs regular expressions. The pattern is a regular expression that should find each attribute in each tag.
Post Reply