Reply to Re: Really hardcore question about PHP needed :)

Your name:

Reply:


Posted by andre rodier on 04/17/07 08:08

Steve wrote:
> | class object
> | {
> | var $lines ;
> | var $posFound ;
> |
> | function object()
> | {
> | $lines = array( ... ) ;
> | ...
> | }
> |
> | function Search($val)
> | {
> | /* Line with error : */
> | array_walk($this->lines, 'searchInLines', $val );
> |
> | /* solution : */
> | array_walk($this->lines, array( $this,'searchInLines'), $val );
> | }
> |
> | function searchInLines(&line, $id, $valueToSearch)
> | {
> | if ( $line[$id] == $valueToSearch )
> | $this->posFound = $id ;
> | }
> | }
>
> you are aware that &line in searchInLines needs to be &$line...AND that you
> are treating it like the array itself when it is actually the VALUE of the
> array at key $id...otherwise searchInLines will never set posFound (which
> you should do when declaring it anyway).
>
> :)
>

Sorry, I have tried to simplify the original function by removing some
lines of code. You can find the original code on the application
'bildo', available here : http://bildo.tuxfamily.org/versions/working/
The file is 'albums/engines/index-dat.php'
But the code works, of course.
You can see a demo here : http://hubix.free.fr/bildo/index.php

[Back to original 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

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