php-db | 2001062
Date: 06/24/01
- Next message: Stephen van Egmond: "Re: [PHP-DB] flash"
- Previous message: Duncan Hill: "Re: [PHP-DB] mysql.com"
- In reply to: Raphael Pirker: "[PHP-DB] number of occurences"
- Next in thread: Adv. Systems Design: "[PHP-DB] AOL and Cookies (sessions) HELP!"
- Reply: Adv. Systems Design: "[PHP-DB] AOL and Cookies (sessions) HELP!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> $number = 123782301247832;
> Now, I'd like to check how many times the letter 1 occurs in there...
Try this:
$number = "123782301247832";
$res = count_chars($number, 1);
$outstr = "";
foreach($res as $key => $val) {
if ($outstr != "")
$outstr .= ", ";
$outstr .= $val." '".htmlentities(chr($key))."'s";
}
echo "<br>'$number' contains $outstr";
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Stephen van Egmond: "Re: [PHP-DB] flash"
- Previous message: Duncan Hill: "Re: [PHP-DB] mysql.com"
- In reply to: Raphael Pirker: "[PHP-DB] number of occurences"
- Next in thread: Adv. Systems Design: "[PHP-DB] AOL and Cookies (sessions) HELP!"
- Reply: Adv. Systems Design: "[PHP-DB] AOL and Cookies (sessions) HELP!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

