-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?

0

1 Answer 1

1

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

array_push($pieData1,  array( "Available seat(s) of ".$pos_chart[$i], $slot_chart[$i]));
Sign up to request clarification or add additional context in comments.

1 Comment

oh i didn't notice about that, such a very little point. Thank you !!! It works now.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.