Skip to content

Instantly share code, notes, and snippets.

@bkmorse
Created March 24, 2014 21:25
Show Gist options
  • Select an option

  • Save bkmorse/9749484 to your computer and use it in GitHub Desktop.

Select an option

Save bkmorse/9749484 to your computer and use it in GitHub Desktop.
private function compare_data($json_data = false, $table_data = false)
{
if($json_data == false || $table_data == false)
return false;
// total number of events do not match, so there has to be a difference
if(count($json_data) != count($table_data))
return false;
foreach($json_data as $json_value)
{
foreach($table_data as $table_value)
{
if($json_value['event_id'] != $table_value['event_id'])
return false;
if($json_value['date_schedule'] != $table_value['date_schedule'])
return false;
if($json_value['city'] != $table_value['city'])
return false;
if($json_value['venue'] != $table_value['venue'])
return false;
if($json_value['buy_link'] != $table_value['buy_link'])
return false;
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment