Skip to content

Commit

Permalink
add helper method to debug query parms
Browse files Browse the repository at this point in the history
  • Loading branch information
michield committed Nov 2, 2015
1 parent a79b8b0 commit 8712c38
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/restapi/includes/common.php
Expand Up @@ -47,4 +47,15 @@ public static function apiUrl($website)

return $url;
}

public static function parms($string,$data) {
$indexed=$data==array_values($data);
foreach($data as $k=>$v) {
if(is_string($v)) $v="'$v'";
if($indexed) $string=preg_replace('/\?/',$v,$string,1);
else $string=str_replace(":$k",$v,$string);
}
return $string;
}

}

0 comments on commit 8712c38

Please sign in to comment.