TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-30-2010, 07:48 AM   #1 (permalink)
The Acquainted
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
maeltar is on a distinguished road
Default Text between tags into array

Been trying to figure this one out and am having probs...

I need to get the data on the [] brackets into an array, any pointers please...


Code:
QuestQueryList = {
        nil, -- [1]
        nil, -- [2]
        nil, -- [3]
        nil, -- [4]
        true, -- [5]
        nil, -- [6]
        true, -- [7]
        nil, -- [8]
        true, -- [9]
        true, -- [10]
        true, -- [11]
        true, -- [12]
        true, -- [13]
        true, -- [14]
        nil, -- [15]
        nil, -- [16]
        nil, -- [17]
        nil, -- [18]
        true, -- [19]
        true, -- [20]
        nil, -- [21]
        true, -- [22]
        nil, -- [23]
        nil, -- [24]
        nil, -- [25]
        nil, -- [26]
        nil, -- [27]
        nil, -- [28]
        nil, -- [29]
        nil, -- [30]
        nil, -- [31]
        nil, -- [32]
        true, -- [33]
        true, -- [34]
        true, -- [35]
        true, -- [36]
        true, -- [37]
        true, -- [38]
        true, -- [39]
        true, -- [40]
        nil, -- [41]
        nil, -- [42]
        nil, -- [43]
        nil, -- [44]
        true, -- [45]
        nil, -- [46]
        true, -- [47]
        nil, -- [48]
        nil, -- [49]
        nil, -- [50]
}
__________________
Thanks... Simon

Sex, Drugs & Linux Rules
Send a message via MSN to maeltar
maeltar is offline  
Reply With Quote
Old 10-30-2010, 07:49 AM   #2 (permalink)
The Acquainted
 
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
maeltar is on a distinguished road
Default

The subject was supposed to read...

"Text between tags into array"
__________________
Thanks... Simon

Sex, Drugs & Linux Rules
Send a message via MSN to maeltar
maeltar is offline  
Reply With Quote
Old 11-03-2010, 09:18 PM   #3 (permalink)
The Acquainted
 
wGEric's Avatar
 
Join Date: Nov 2007
Posts: 166
Thanks: 0
wGEric is on a distinguished road
Default

You can do that using preg_match_all. The reg ex pattern would be something like #\[([0-9]*)\]#
__________________
Eric
wGEric is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Explode an array + add start and end tags? marxx General 7 09-26-2008 12:02 PM
Echoing Text File Rows into Array Display... buildakicker General 11 02-04-2008 07:17 PM
Text File Into Array Nathan Absolute Beginners 10 12-03-2007 08:20 PM
PDF Creation - Help! Sam Granger General 7 10-31-2007 11:32 AM
Part 1: Getting Started with Array Functions Wildhoney Absolute Beginners 6 10-01-2007 10:53 AM


All times are GMT. The time now is 05:45 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design