array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'function.gmp-scan0.php', 1 => 'gmp_scan0', ), 'up' => array ( 0 => 'ref.gmp.php', 1 => 'Fonctions GMP', ), 'prev' => array ( 0 => 'function.gmp-rootrem.php', 1 => 'gmp_rootrem', ), 'next' => array ( 0 => 'function.gmp-scan1.php', 1 => 'gmp_scan1', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/gmp/functions/gmp-scan0.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.4, PHP 5, PHP 7, PHP 8)
gmp_scan0 — Recherche 0
Recherche dans num1
,
en commençant à la position start
, vers les bits
de poids lourd, jusqu'à ce qu'elle rencontre un bit à 0.
num1
Le nombre à analyser.
Un objet GMP, un entier, ou une chaîne de caractères numérique.
start
Le bit de départ.
Retourne l'index du bit trouvé, sous la forme d'un entier. L'index commence à 0.
Exemple #1 Exemple avec gmp_scan0()
<?php
// le bit "0" est trouvé à la position 3. l'index commence à 0
$s1 = gmp_init("10111", 2);
echo gmp_scan0($s1, 0) . "\n";
// le bit "0" est trouvé à la position 7. l'index commence à 5
$s2 = gmp_init("101110000", 2);
echo gmp_scan0($s2, 5) . "\n";
?>
L'exemple ci-dessus va afficher :
3 7