PHP – Reset Array keys

To reset the array keys by taking array values only and stored it destination array.

The syntax is

$arr_destination = array_values($arr_source);

Suppose we take an example of array as

$arr_data = array(10,20,”three”=>30);

To reset the above array by

$arr_data1 = array_values($arr_data);

The output of the above example is,

$arr_data1 = array(10, 20, 30);

About selvam4win

I am Selvam. I am very jolly person and frank one.

Posted on March 24, 2010, in PHP, Uncategorized and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: