-2

I'm new to PHP, I tried to use the array push function which I would like to combine the string with variable but it turns out strange result.

I applied it to Google Chart which it will create the chart.

for($i = 0; $i < $table_counter; $i++){

    array_push($pieData1,  array( "Available seat(s) of " + $pos_chart[$i], $slot_chart[$i]));

}

This is the code that I use for array that it use to create the chart. The chart is generated, the header of the chart should be "Available seat(s) of xxx position" but it turns out as "0".

So, what I should change?

gznero
  • 195
  • 8

1 Answers1

1

You need to use "." operator to concatenate the string.

array_push($pieData1,  array( "Available seat(s) of ".$pos_chart[$i], $slot_chart[$i]));
Krunal
  • 297
  • 1
  • 7