splitting up a variable.

I've got a variable that looks like this:
$variable="this file can,be deleted,is this ok";
Now I want this variable to be splitted up , in three other variables namely $var1 and $var2 and $var3, at the point where the , resides. The outcome must look like this:
$var1="this file can";
$var2="be deleted";
$var3="is this ok";
(note: I don't want the , to be either in $var1 or $var2 or $var3)

Can someone help me out ?
oostwijkAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
akfConnect With a Mentor Commented:
If this is in Perl (which it looks like), it's easy:

($var1, $var2, $var3) = split(',' , $variable);

0
 
akfCommented:
If this is in Perl (which it looks like), it's easy:

($var1, $var2, $var3) = split(',' , $variable);

0
 
oostwijkAuthor Commented:
Ok, that does the job :))
0
All Courses

From novice to tech pro — start learning today.