Mysql Explode Function
#1

What is this xD
PHP код:
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;

Reply
#2

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:
pawn Код:
string = "Hey, this is a string"
And use that function on it like so:
pawn Код:
new output[6][16];
explode(string, output, " ");
Will result in the array "output" values being:
pawn Код:
for(new i = 0; i < sizeof(output); i++)
    print(output[i]);
// Will print:
// Hey,
// this
// is
// a
// string
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)