Skip to content

Instantly share code, notes, and snippets.

@ericboehs
Created January 13, 2010 18:23
Show Gist options
  • Select an option

  • Save ericboehs/276426 to your computer and use it in GitHub Desktop.

Select an option

Save ericboehs/276426 to your computer and use it in GitHub Desktop.
<?php
$competitions = array(
0 => array(
'id' => '12345',
'result_scope' => array(
'competition-status' => 'scheduled',
),
),
1 => array(
'id' => '32451',
'result_scope' => array(
'competition-status' => 'in-progress',
),
),
2 => array(
'id' => '21453',
'result_scope' => array(
'competition-status' => 'in-progress',
),
),
);
$competition_status = 'in-progress';
foreach($competitions as $index => $competition){
if($competition['result_scope']['competition-status'] != $competition_status)
unset($competitions[$index]);
}
$competitions = array_values($competitions);
echo "<pre>"; print_r ($competitions); die("</pre>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment