0
in an sql query, it returns me this value 10,30,40,50 of the fields" mark_ups_range"
How to read and quabrar in lines this values? exemology
10
30
40
50
$sql1 = "SELECT mark_ups_range FROM config_politicas WHERE id_transfer = '1' ";
$resultado1 = mysql_query($sql1) or die( mysql_error());
while ($linha = mysql_fetch_assoc($resultado1)) {
$id2=$linha['mark_ups_range'];// 10,30,40,50
}
$arr = explode(', ', $id2);
foreach ($arr as $v) {
echo '<br>';
echo $arr;
}
There’s an extra space in your explosion
– Roberto de Campos
Replace that
$arr = explode(', ', $id2);
therefore$arr = explode(',', $id2);
.– Roberto de Campos
returns me like this Array Array Array
– Fabio Henrique