PHP 8.5.0 Alpha 2 available for testing

Voting

: max(three, two)?
(Example: nine)

The Note You're Voting On

gfuente at garrahan dot gov dot ar
8 years ago
If the element to be pushed onto the end of array is an array you will receive the following error message:

Unknown Error, value: [8] Array to string conversion

I tried both: (and works, but with the warning message)

$aRol = array( $row[0], $row[1], $row[2] );
$aRoles[] = $aRol;

and
array_push( $aRoles, $aRol);

The correct way:

$cUnRol = implode("(",array( $row[0], $row[1], $row[2] ) );
array_push( $aRoles, $cUnRol );

thanks.

<< Back to user notes page

To Top