is there a way to get the n-th element of a splitted string without using a variable?
My PHP code always looks like this:
$foo = explode(\" \", \"bla
close. the right track is making a function or method for something that gets repeated.
function extract_word($input, $index) { $input = explode(' ', $input); return $input[$index]; }
add a third argument of $separater = ' ' if you may have different word separaters.