<-- snip -->
> Hi, I want to add a new element to an array in php, is the following way
the
> correct way? assuming that $chk is an array and $ID contains a value.
>
>
> $j = count($chk);
> $j++;
> $chk[$j] = $ID;
<-- snip -->
Yes that is one method of doing it. another method of adding an elemen
Hi Angelo Zanetti, you wrote:
Hi, I want to add a new element to an array in php, is the following way the
correct way? assuming that $chk is an array and $ID contains a value.
$j = count($chk);
$j++;
$chk[$j] = $ID;
Keep it simple, this is enough:
$chk[] = $ID;
This appends
2 matches
Mail list logo