SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > 0.3.7 RC Scripting

 
 
Thread Tools Display Modes
Old 31/05/2015, 01:09 PM   #1
nezo2001
Gangsta
 
Join Date: Nov 2014
Location: Cairo, Egypt
Posts: 687
Reputation: 26
Default Mysql Explode Function

What is this xD
PHP Code:
explode(const sSource[], aExplode[][], const sDelimiter[] = " "iVertices sizeof aExplodeiLength sizeof aExplode[]) // Created by Westie
{
    new
        
iNode,
        
iPointer,
        
iPrevious = -1,
        
iDelimiter strlen(sDelimiter);

    while(
iNode iVertices)
    {
        
iPointer strfind(sSourcesDelimiterfalseiPointer);

        if(
iPointer == -1)
        {
            
strmid(aExplode[iNode], sSourceiPreviousstrlen(sSource), iLength);
            break;
        }
        else
        {
            
strmid(aExplode[iNode], sSourceiPreviousiPointeriLength);
        }

        
iPrevious = (iPointer += iDelimiter);
        ++
iNode;
    }
    return 
iPrevious;

__________________
Quote:
Originally Posted by Human
When im met u, u were nub at scripting xD.

But now, i'm impressed. Good job.
Don't look at my history. Everyone started somewhere
nezo2001 is offline  
Old 31/05/2015, 06:53 PM   #2
dusk
High-roller
 
dusk's Avatar
 
Join Date: Jul 2008
Posts: 1,118
Reputation: 46
Default Re: Mysql Explode Function

First of all, this has nothing to do with 0.3.7.

This function splits a string by another string. For example if you have a string:
Code:
string = "Hey, this is a string"

And use that function on it like so:
Code:
new output[6][16];
explode(string, output, " ");

Will result in the array "output" values being:
Code:
for(new i = 0; i < sizeof(output); i++)
    print(output[i]);
// Will print:
// Hey, 
// this
// is
// a
// string
dusk is offline  
 

Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql explode question Tanush123 Scripting Help 1 28/05/2013 12:07 PM
Explode() function? xGoldenx Scripting Help 2 11/01/2012 05:23 PM
[MYSQL] Explode vection Help Archive 1 13/09/2010 08:00 PM
MySQL Explode Reader vection Help Archive 5 11/09/2010 03:21 PM
include with explode function mario713 Help Archive 4 09/02/2010 01:39 PM


All times are GMT. The time now is 02:27 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.