I have two preexisting variables:
$side (which is either F or B)
and
$plate (which is a 3 digit number)
I am trying to build two arrays called
$sidecountF
and
$sidecountB
using the following code:
$sidecount{$side}[$plate] = 1;
assuming $side is F and $plate is 200, I'm hoping that the end result is that
$sidecountF[200] = 1;
I am, at the beginning, declaring sidecountF and sidecountB as arrays with
$sidecountF = array();
$sidecountB = array();
So now I'm stumped.
${"sidecount$side"} = array();
But you're better off using arrays:
$sidecount = array("F" = array(), "B" => array());
$sidecount[$side][$plate] = /* ... */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With