Tidying code for PHP5.0.5/PHP4.4.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux