Is there a shorter way to do this?

Hi Guys!

I was wondering if there was a quicker way to do what I have done below (maybe using array_map?). Any help is appreciated.


if(!empty($array['skills']['skill']))
					{
						$skill_array = array();
						
						foreach($array['skills']['skill'] as $key=>$value)
						{
							$skill_array[] = $array['skills']['skill'][$key]['skill']['name'];
						}
						$_SESSION['linkedin_data']['skills'] = implode(', ',$skill_array);
					}

Thanks.

I see nothing wrong with it.

Only thing I would of done differently is

$skill_array = $value[‘skill’][‘name’];

But it’s just cuz that uber long array spams “skill” too many times for my taste :wink: