domingo, 25 de febrero de 2018

couting first array value and remove it

<?php

$queue=array(1,2,3,4,5);

foreach($queue as $value){
$post=current($queue);
echo current($queue);
array_shift($queue);


echo "<br>";


}

?>

will be used for a custom asterisk queue

sábado, 17 de febrero de 2018

array callback fuctions

<?php
//////////apply  this  fuction   to  all values of input array 
function cube($n)
{
    return($n * $n * $n);
}

$a = array(1, 2, 3, 4, 5);
$b = array_map("cube", $a);
print_r($b);



code 2

//////////////////////////// return an array  with all values of input array  > 2
function fuv($n)
{

if($n>2) {
return true;
}

}

$c=array_filter($a,"fuv");
print_r($c);

lunes, 5 de febrero de 2018

google vision image api

 curl -X POST -H "Content-Type: application/json"   -d '{"requests":  [{ "features":  [ {"type": "LABEL_DETECTION"}], "image": {"source": { "imageUri": "https://storage.googleapis.com/ambiorixg12/image2.jpg"}}}]}'   https://vision.googleapis.com/v1/images:annotate?key=mykey


https://cloud.google.com/vision/docs/using-curl


https://cloud.google.com/vision/docs/auth#using_an_api_key


https://cloud.google.com/vision/docs/reference/rest/v1/images/annotate#ImageSource