You are here: Tidying code for PHP5.0.5/PHP4.4.0 « PHP « IT news, forums, messages
Tidying code for PHP5.0.5/PHP4.4.0

Posted by Lester Caine on 09/20/05 10:31

This type of code is used in a few places, so I'd like a little help
converting it to 'good code' under the new rules ;)

Get the key from an array ( fails because key(&array) )
----
if( $pId == key( $this->getFunc() ) ) {

In getFunc()
----
return ( $this->getAssoc("select Id, Content from database...");

Current fix is just to create the array and use that
$keyarray = $this->getFunc();
if( $pGroupId == key( $keyarray ) ) {

This works fine, but is there a 'proper' way to do it now that what
looked tidy originally fails with an error?

Lester Caine
-----------------------------
L.S.Caine Electronic Services

 

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

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