Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to convert into array?

Status
Not open for further replies.

seahorse123

Programmer
Jul 25, 2005
39
0
0
US
If I have $v[]="1,2,3", how can I convert this into an array:
$v[0]=1
$v[1]=2
$v[2]=3

thanks.
 
$v[]= "1,2,3";
$var= $v[];
$me = explode(",",$var);
print_r($me);

output:
Array ( [0] => 1 [1] => 2 [2] => 3 )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top