FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Find Strings (Tokens) in File and push them into an array - How?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Find Strings (Tokens) in File and push them into an array - How? [message #169548 is a reply to message #169544] Fri, 17 September 2010 13:31 Go to previous messageGo to previous message
DigitalDude is currently offline  DigitalDude
Messages: 7
Registered: September 2010
Karma:
Junior Member
Hey,

ok I did it like this:

foreach($files as $file) {
$handle = file_get_contents($file);
preg_match_all('/(\$__txt[^;]*);/', $handle, $matches);
if(!empty($matches[0])) {
foreach($matches[0] as $token) {
array_push($tokens, $token);
}
}
}

The result Array looks like this:

Array
(
[0] => $__txtTokenInFrontend1;
[1] => $__txtTokenInFrontend2;
[2] => $__txtTokenInFrontend3;
)

which is exactly what I needed. So thanks guys, especially Matt for
the great reg-ex!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Advanced SQL injection complete tool pack(tutorials,scanners,admin finder,shells,md5)
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 11:11:16 GMT 2024

Total time taken to generate the page: 0.03837 seconds