Jump to content

[SOLVED] Break Apart Strings


proggR

Recommended Posts

Is there anyway to break apart a string into groups? I have a string thats formatted DATE_COURSE_TITLE and i was wondering if there's a function that can grab any characters after the second underscore?

And I don't need this to use but for knowledge sake, is there anyway to grab just between the two underscores as well? I'm guessing something like:

 

$i = 0

if (character == "_"){

getcharacter;

if (character == "_"){

$word = $buffer;

}

else{

$buffer[$i] = getcharacter;

$i = $i+1;

}

 

would work but i was wondering if there was a function that would do it. even if i have to find the placement of each underscore and just feed start and end points into the function or something. althought i guess i could write that myself.

anyway. i'm rambling because I'm in a hurry. Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/114366-solved-break-apart-strings/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.