Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #17640
| Path | csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Arno Welzel <usenet@arnowelzel.de> |
| Newsgroups | comp.lang.php |
| Subject | Re: filter function for odd and even in a for loop |
| Date | Fri, 5 Jan 2018 02:07:42 +0100 |
| Lines | 24 |
| Message-ID | <fb81euFpc8eU1@mid.individual.net> (permalink) |
| References | <3a933c1c-9f1e-49a5-9792-1dff43669940@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | individual.net 0D+1z8/c9Lb8wiTv/oZ0fwdQMmxn9mxjYrwbACuoSnBTr8X3nP |
| Cancel-Lock | sha1:CTuX40y7fHEgLHShJFKwOvAmLfU= |
| In-Reply-To | <3a933c1c-9f1e-49a5-9792-1dff43669940@googlegroups.com> |
| Xref | csiph.com comp.lang.php:17640 |
Show key headers only | View raw
jans:
> The two included filter functions work from php manual. What I want
> them to do is if it is even print the number. If it is odd print
> "odd"; I am not getting a result in the for loop?[...]
> for ($i=0; $i<= sizeof($arr); $i++){
> if ($arr_filter($arr,'even')==1){
> print_r($arr=>$i);
> }elseif($arr_filter($arr,'odd')==1)
> {
> print_r('odd');
> }
> }
What is this? This code makes no sense at all.
Turn on error reporting and see for yourself.
--
Arno Welzel
https://arnowelzel.de
https://de-rec-fahrrad.de
http://fahrradzukunft.de
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
filter function for odd and even in a for loop jans <janis.rough@gmail.com> - 2018-01-04 14:45 -0800
Re: filter function for odd and even in a for loop Jerry Stuckle <jstucklex@attglobal.net> - 2018-01-04 20:01 -0500
Re: filter function for odd and even in a for loop inigojoseph89@gmail.com - 2018-01-23 02:05 -0800
Re: filter function for odd and even in a for loop Jerry Stuckle <jstucklex@attglobal.net> - 2018-01-23 07:51 -0500
Re: filter function for odd and even in a for loop Arno Welzel <usenet@arnowelzel.de> - 2018-01-05 02:07 +0100
Re: filter function for odd and even in a for loop Mark Lloyd <not@mail.invalid> - 2018-01-05 14:11 -0600
Re: filter function for odd and even in a for loop "J.O. Aho" <user@example.net> - 2018-01-05 21:52 +0100
csiph-web