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 #169544 is a reply to message #169541] Fri, 17 September 2010 13:04 Go to previous messageGo to previous message
DigitalDude is currently offline  DigitalDude
Messages: 7
Registered: September 2010
Karma:
Junior Member
On 17 Sep., 14:31, matt <matthew.leonha...@gmail.com> wrote:
> On Sep 17, 8:17 am, DigitalDude <e.blumsten...@googlemail.com> wrote:
>
>> Just for the record: the parsing is not the problem, just how to get
>> the token from the file into my array. I need to copy each token that
>> matches a pattern (e.g. "$__txt" or so) and then save it as a string
>> into an array (which I would probably do with array_psuh or so).
>
> Sounds like you need regex:
>
> preg_match_all("/(\$__txt[^;]*);/", $fileTextString, $matches);
> print_r($matches);
>
> Not a complicated job to take structure of $matches and manipulate it
> to your needs.
>
> ref:http://us2.php.net/manual/en/book.pcre.php


Hey,

yeah that seems to be the right approach, although I get a lot of
emtpy arrays this way. I hope I can modify this to a working version,
I cannot believe it is so complicated to setup such a trivial
function...
[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: Fri Sep 20 19:23:51 GMT 2024

Total time taken to generate the page: 0.03929 seconds