Skip to content

Instantly share code, notes, and snippets.

@SeoRoman
Forked from matula/array.php
Created January 7, 2014 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SeoRoman/8305934 to your computer and use it in GitHub Desktop.
Save SeoRoman/8305934 to your computer and use it in GitHub Desktop.
<?php
$social_data = [
[
'first' => 'John',
'middle' => 'Smith',
'last' => 'Doe',
'email' => 'abc@example.com'
],
[
'first' => 'John',
'last' => 'Doe',
'email' => 'abc@example.com'
],
[
'first' => 'John',
'last' => 'Doe',
]
];
$new = [];
foreach ($social_data AS $d)
{
$new[] = [
'full_name' => $d['first'] . ' ' . $d['middle'] . ' ' . $d['last'],
'email_address' => $d['email']
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment