<?php
function func($text) {
$array = explode(' ', $text);
for($i = 0; $i < count($array, COUNT_RECURSIVE); $i++){
$output = substr($array[$i], strpos($array[$i], "=") + 1);
echo $output, '<br>';
}
}
func("arg1=Test1 arg2=test1 arg3=test3");
?>
So this code obviously outputs test1, test2 and test3, which i want it to.
Now how do i get the arg's as well?
This is what i want to do:
if(exists('arg1' || 'arg2' || 'arg3') {
echo "args exists";
} else {
echo "args don't exist";
}
Hope you understand, thanks!