# HG changeset patch # User Michiel Broek # Date 1408535504 -7200 # Node ID fb930d1db5a64ed0f476ef93b3d4f9ebad26f163 # Parent b29f80afaeac7b27fd1f61c2682adfb4bd26fa29 Added function send_array_check diff -r b29f80afaeac -r fb930d1db5a6 www-thermferm/utilities.php --- a/www-thermferm/utilities.php Wed Aug 20 13:10:10 2014 +0200 +++ b/www-thermferm/utilities.php Wed Aug 20 13:51:44 2014 +0200 @@ -113,6 +113,23 @@ +/* + * @param array $command to send to the server. + * Return: 0 = Ok. + * 1 = Server responden with an error. + */ +function send_array_check($command) +{ + $answer = send_array($command); + + if (strlen($answer) && (($answer[0] == '1') || ($answer[0] == '2'))) + return 0; + + return 1; +} + + + function startsWith($haystack, $needle) { return !strncmp($haystack, $needle, strlen($needle));