Re: request
| From: | David T-G | Date: | Mon, 21 Apr 2003 10:25:33 +0000 |
| Subject: | Re: request | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144620@lists.php.net to get a copy of this message | ||
Marius --
..and then Marius said...
%
% <?php
% $username1 = "user1";
% $userage1 = "1981-3-1";
% $username2 = "user2";
% $userage2 = "1983-5-12";
%
% $findage = "22";
%
% while($users = ){
% echo "User $name is $findage years old";
% }
% ?>
%
% what I should do that it echo'es users names who is $findage years
% old
Do you mean something like
for all of my users
subtract the birth date from today
compare to the specified target
if the comparison matches
print the name
else
do nothing
for your process?
I would set up an associative array about like
$users
(
'user1' => '1981-3-1' ,
'user2' => '1983-5-12' ,
...
) ;
and then walk through the list doing my comparison.
If that's not what you mean, then please clarify.
%
% --
% Marius
% mariusrk@delfi.lt
HTH & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!