Jump to content

robkar32

New Members
  • Posts

    5
  • Joined

  • Last visited

robkar32's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes. I just want to split up the arg values, and the values assigned to them, or the "test" values in different arrays and know where they are. Only thought of a way to get the values, and not the args. Yeah, i'm pretty new to this, and by the way i am not using this code for something big that i even need to worry about the data format.
  2. <?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!
×
×
  • 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.