Convert this associative array to a string or single indexed array

ameliajakarta

New Member
I need to convert this array into a single dimensional indexed array or a string. Happy to discard the first key (0, 1) and just keep the values.\[code\]$security_check_whitelist = array 0 => array 'whitelisted_words' => string 'Happy' (length=8) 1 => array 'whitelisted_words' => string 'Sad' (length=5)\[/code\]I tried array_values(), but it returned the exact same array structure.This works:\[code\]$array_walker = 0;$array_size = count($security_check_whitelist);while($array_walker <= $array_size){ foreach($security_check_whitelist[$array_walker] as $security_check_whitelist_value) { $security_check[] = $security_check_whitelist_value; } $array_walker++;}\[/code\]But it returns:\[quote\] Warning: Invalid argument supplied for foreach()\[/quote\]How can I convert the associative array without receiving the warning message? Is there a better way?
 
Back
Top