Chartjs-Cant pass variable for some reason? PHP

0👍

The double quotes in $xvalue will match the double quotes that are used to delimit the value="..." attribute. You need to encode them:

<input type="text" name="xvalue" value="<?php echo htmlspecialchars($xaxis); ?>">

0👍

You problably need to do two things:

  1. As Barmar said, you cannot “simply” echo an array. You need to parse it into value, for example

    value="implode(';', $array)"

  2. Another option is to declare multiple inputs, each with one value for your array.

Leave a comment