Online Degrees & Certificates : LP Programs Matrix page | Template = docs | Brand = docs | Academic Area =

How the JSON array system works.

All data originate in the Master Spreadsheet

Order of Operations

  1. Data entry takes place in the Spreadsheet (much of the field info is automated with functions [YAY!!])
  2. The Spreadsheet uses the Export Sheet Data plugin to output a nice big JSON array.
  3. The JSON array/objects are then ingested/decoded with two simple lines of code:

    $json_a = file_get_contents("programs.json");
    $matrix = json_decode($json_a,true);

  4. The rest is figuring out what data you want to query and how to properly return it using RegEx and/or basic logic.

Examples

Linked Subset by Degree Type Example

  
    //Loop through $matrix array by program
    foreach ($GLOBALS["matrix"][programs] as $program) {
    //if there is a word match for the associate degree type
      if (preg_match("/\baa\b/", $program['degreeLevel']['degreeLevel'], $pass_fail) == true)
    //then echo out the linked LP
      {
         echo '
  • ' . $program['name'] . ' - ' . $program['degreeLevel']['aa']['abbr'] .'
  • '; echo "\n"; } }