Im sure this is super simple. im trying to pass values held in a var into another var as an array.
I have a var $guideinValue that contains string of values separated by commas. the values stand for category ids.
when i echo $guideinValue it shows 18,19 which are the proper category id's.
im trying to use these in the wordpress var $selected_cats.
when i manually punch into $selected_cats = array(18,19); everything works
and a print_r of 1$selected_cats1 shows Array ( [0] => 18 [1] => 19 )
but when i use $selected_cats = array($guideinValue);, a print_r shows Array ( [0] => 18,19 ) and nothing works ofc
Why does this happen and how do i fix my syntax?
$selected_cats = explode(',', $guideinValue);you'll get output in array format