note 106193 added to function.ldap-search

From: Date: Tue, 18 Oct 2011 07:23:52 +0000
Subject: note 106193 added to function.ldap-search
Groups: php.notes 
Request: Send a blank email to php-notes+get-183948@lists.php.net to get a copy of this message
<?php function numara($x,$o) { $contor=0; while($x>0) { $r=$x%10; if($r%2==$o) $contor++; $x=$x/10; } return $contor; } $a=1234; $b=1234; $a1=numara($a,0); $b1=numara($b,1); echo "cifre pare: ".$a1; echo "cifre impare: ".$b1; ?> This program should show me the number of odd and even numbers in 1234; the problem is it adds at the number of even numbers 324. I just can't find anything wrong with it... any ideeas? thanks in advance! ---- Server IP: 69.147.83.197 Probable Submitter: 93.114.96.30 ---- Manual Page -- http://www.php.net/manual/en/function.ldap-search.php Edit -- https://master.php.net/note/edit/106193 Del: integrated -- https://master.php.net/note/delete/106193/integrated Del: useless -- https://master.php.net/note/delete/106193/useless Del: bad code -- https://master.php.net/note/delete/106193/bad+code Del: spam -- https://master.php.net/note/delete/106193/spam Del: non-english -- https://master.php.net/note/delete/106193/non-english Del: in docs -- https://master.php.net/note/delete/106193/in+docs Del: other reasons-- https://master.php.net/note/delete/106193 Reject -- https://master.php.net/note/reject/106193 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#183948) next »