示例#1
0
function get_val($input)
{
    if (is_bool($input)) {
        return $input ? 'true' : 'false';
    }
    if (is_numeric($input)) {
        return $input;
    }
    if (is_null($input)) {
        return "NULL";
    }
    return '"' . safe_val($input) . '"';
}
示例#2
0
         //counts counts number of uses of each end point
         $counts = array();
         if (is_array($sel)) {
             foreach ($sel as $row) {
                 foreach (array('end1', 'end2') as $fld) {
                     if (!isset($counts[$row[$fld]])) {
                         $counts[$row[$fld]] = 0;
                     }
                     $counts[$row[$fld]]++;
                 }
             }
         }
         //sort by number of uses and convert value from just count to count and stop/station name
         arsort($counts);
         foreach ($counts as $pnum => $val) {
             $counts[$pnum] = $val . ' ' . safe_val($stops, $pnum);
         }
         //go through list of stops and find any stop not in the counts
         //all stop records of a given type
         $missing = array();
         foreach ($stops as $pnum => $stop) {
             if (!isset($counts[$pnum])) {
                 $missing[$pnum] = $stop;
             }
         }
         qpre(count($missing), $missing, count($sel), count($counts), $counts);
     }
     break;
 case 10:
     //used to run isolated shortest path test for specific nodes
     $data = file_get_contents($links_path, FILE_BINARY);