Raised This Month: $ Target: $400
 0% 

Regex - Help with loop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
grs4
Senior Member
Join Date: Dec 2010
Location: Poland
Old 06-22-2014 , 10:33   Re: Regex - Help with loop
Reply With Quote #1

Use Explode function from php ;p
Code:
new string[] = "str1-str2-str3-str4"  
new str[4][5], num

explode(string, '-', str[num++], 3, 4)

client_print(0,3, "%s %s %s %s", str[0], str[1, str[2], str[3])
stock explode(const string[],const character,output[][],const maxs,const maxlen){
    
    new     iDo = 0,
    len = strlen(string),
    oLen = 0;
    
    do{
        oLen += (1+copyc(output[iDo++],maxlen,string[oLen],character))
    }while(oLen < len && iDo < maxs)
}

Last edited by grs4; 06-22-2014 at 10:33.
grs4 is offline
Reply



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode