You are here: Re: Recurse an array with an object/s « PHP Programming Language « IT news, forums, messages
Re: Recurse an array with an object/s

Posted by Jerry Stuckle on 02/07/07 16:31

Aggelos wrote:
> On Feb 7, 2:53 pm, "petersprc" <peters...@gmail.com> wrote:
>> Hi,
>>
>> Please try: return recurseArray($arrayValue);
>>
>
> That would just loop forever... won't it ?
>

Not unless you have a loop in your array itself.

Your problem is you're only returning something if the last item in the
first level of your array is an object. Otherwise you're not returning
anything - so print_r has nothing to print.

But one question - you say you have a two dimensional array. But this
is only a single dimensional array. It just happens that an array
element might itself be an array. That's not two dimensions.

Why not try posting some sample data and what you're trying to get out
of it? Then maybe we could help you a little better.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация