Hi folks,
Got a question regarding arrays, hoping someone can help.
I have an array which is being output in this format when I do var_dump to it:
array(16) {
[3]=> string(1) "0"
[4]=> string(1) "1"
[5]=> string(1) "0"
[6]=> string(1) "0"
[7]=> string(1) "0"
[8]=> string(1) "0"
[9]=> string(1) "0"
[10]=> string(1) "0"
[11]=> string(1) "0"
[12]=> string(1) "1"
[13]=> string(1) "0"
[14]=> string(1) "0"
[15]=> string(1) "1"
[16]=> string(1) "0"
[17]=> string(1) "1"
[18]=> string(1) "1"
}
Basically I'm trying to convert it so that it comes out like the array below.
[18]=> string(1) "1"
For each item the number in the square brackets is a database value, I want to store this as an INT value for the ones which are marked "1" is disregard the ones marked "0"
array(2) {
[0]=> int(105)
[1]=> int(125)
}
I can't change the way the array is being created so is it possible to convert it somehow?