User Tools

Site Tools


phpsqlet:booleans

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

phpsqlet:booleans [2016/04/13 16:49] – created leophpsqlet:booleans [2016/04/13 16:52] (current) leo
Line 1: Line 1:
-|<- [[Associative arrays]]|[[Booleans]] ->|+|<- [[Arrays functions]]|[[NULL and empty]] ->|
  
-===== Array Functions =====+===== Booleans =====
  
-Beaucoup de fonctions.+true or false.
  
 <code> <code>
-$array(3,2,4);+$bool true; // ou TRUEcase insensitive 
 +$bool = false// ou FALSE
  
-// count, min, max +echo is_bool($bool); // test de booléanité (bô néologisme)
- +
-echo count($a); // 3 : longueur +
-echo min($a); // 2 : valeur minimum +
-echo max($a); // 4 : valeur maximum +
- +
- +
- +
-/sort, rsort +
- +
-// fonction destructive : agit sur le tableau +
-sort($a); // 2,3,4 : tri croissant +
-rsort($a); // 4,3,2 : tri décroissant +
- +
- +
- +
-// implode, explode +
- +
-$string = implode(" * ", $a); // "4 * 3 * 2" +
-$b = explode(" * ",$string); // 4,3,2 : crée un array +
- +
- +
-// recherche +
-echo in_array(0, $a); // rien (false) +
-echo in_array(2, $a); // (true)+
 </code> </code>
- 
--> php.net/manual/en/ref.array.php 
- 
-  * array_keys 
-  * array_values 
-  * array_push 
-  * array_pop 
-  * array_shift 
-  * array_unshift 
-  * array_unique 
-  * array_search 
-  * array_random 
-  * etc. 
phpsqlet/booleans.1460558946.txt.gz · Last modified: 2016/04/13 16:49 by leo