break multiple variables within one variable

I have a 3 variables sent through a single post variable which I nned to break up

eg: posted value: [4546-B9487521-8] or like [6040-589A7S8-12] as you could see the 3 variables are separated by hyphens and the variables do not have the same length all the time

then name the value after it was broken
var1 = 4546
var2 = B9487521
var3 = 8
bdipasqualeAsked:
Who is Participating?
 
steelseth12Commented:
$temp = explode("-",$_POST["var_name"]);
      
      $var1 = $temp[0];
      $var2 = $temp[1];
      $var3 = $temp[2];
0
 
steelseth12Commented:
You might want to look at

 http://www.php.net/manual/en/function.explode.php

for more information on the explode() function.
0
 
x_bakosCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.