Skip to content

Instantly share code, notes, and snippets.

@kastaneda
Created December 14, 2011 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kastaneda/1476031 to your computer and use it in GitHub Desktop.
Save kastaneda/1476031 to your computer and use it in GitHub Desktop.
Test test test
<?php
$data = array(
array(
'id' => 101,
'name' => 'Foo',
),
array(
'id' => 102,
'name' => 'Bar',
),
array(
'id' => 150,
'name' => 'Baz',
),
);
$IDs = array();
foreach ($data as $row) {
$IDs[] = $row['id'];
}
echo join(', ', $IDs);
// Will print '101, 102, 150'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment