Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Meekness: Uncommon patience in planning a revenge that is worth while. -- Ambrose Bierce


devel / comp.lang.php / Re: array_filter with two conditions

SubjectAuthor
o Re: array_filter with two conditionsPostiljon Petskin

1
Re: array_filter with two conditions

<f8b78183-a441-4e48-a45b-b2978006fa68n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=843&group=comp.lang.php#843

  copy link   Newsgroups: comp.lang.php
X-Received: by 2002:a05:620a:24d5:b0:74e:167:7064 with SMTP id m21-20020a05620a24d500b0074e01677064mr2298689qkn.5.1682178458121;
Sat, 22 Apr 2023 08:47:38 -0700 (PDT)
X-Received: by 2002:aed:27d5:0:b0:3ee:d531:31f6 with SMTP id
m21-20020aed27d5000000b003eed53131f6mr2062327qtg.2.1682178457967; Sat, 22 Apr
2023 08:47:37 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.php
Date: Sat, 22 Apr 2023 08:47:37 -0700 (PDT)
In-Reply-To: <fe3760f6-83ed-47b3-8402-880fd3d26408@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=82.131.36.15; posting-account=JYCD-AoAAABJjYHTEug7bzEvKBag4Jpy
NNTP-Posting-Host: 82.131.36.15
References: <fe3760f6-83ed-47b3-8402-880fd3d26408@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f8b78183-a441-4e48-a45b-b2978006fa68n@googlegroups.com>
Subject: Re: array_filter with two conditions
From: yyyyyyyyyyyywwwww@zohomail.eu (Postiljon Petskin)
Injection-Date: Sat, 22 Apr 2023 15:47:38 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2229
 by: Postiljon Petskin - Sat, 22 Apr 2023 15:47 UTC

On Friday, January 5, 2018 at 2:11:50 AM UTC+2, jans wrote:
> I am having trouble debugging this? I can't get it to print out the value if it is even or the word "odd" if it is odd? The initial funcitons work but I don't know how to use the array_filter with two conditions? thanks,
> function odd($var)
> {
> // returns whether the input integer is odd
> return($var & 1);
> }
>
> function even($var)
> {
> // returns whether the input integer is even
> return(!($var & 1));
> }
>
> $arr = array(1,2,6,7,9,4,10,11,12,3,13,24);
> $keys = array_keys($arr);
>
> for ($counter = 0, $length = count($arr);$counter < $length; $counter++)
> {
> $key = $keys[$counter];
> $value = $array[$key];
> if ($arr_filter($arr,'even')==1){
> print_r($array[$key];);
> }elseif($arr_filter($arr,'odd')==1)
> {
> print_r('odd');
> }
> }

You agree, that You are the most unoriginal person in the history of the universe ?

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor