This is extra code in a Drupal view table template so $row = the content I get..
var_dump($row);
// output:
array(5) {
["field_datum"]=> string(0) ""
["field_werf"]=> string(9) "Comis Cui"
["field_machine"]=> string(17) "Graafmachien D293"
["field_aantal_uren"]=> string(1) "5"
["view_node"]=> string(50) "Bekijk"
}
$uren = $row['field_aantal_uren'];
var_dump($uren);
// output: string(1) "5" string(1) "7" string(1) "1"
I've tried everything from explode, str_replace, preg_replace to get the 3 strings in an array so I can loop over them them and make a sum. But I can't make it work..
Any suggestions to transform this variable to an array?
$var1 + $var2 + $var3
??? – str Apr 25 at 10:44