php - Save SQL column value to an array -


i want save value array. have column called numbers values 1,2,3.

if select value, save variable $value , try put array:

$array = array($value);

but not working properly.

php not automatically convert strings integers. dump showed 1 string, this:

// separate comma array $array = explode("," $str); // array( '1', '2', '3' );  // re-create array, converting strings integers foreach ($array $index => $value) {     $array[$index] = (int)$value;  } 

Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -