How PHP converts array values into keys, PHP arrays into keys
The example in this article describes how PHP converts array values into keys. Share it with everyone for your reference. The details are as follows:
function values2keys($arr, $value=1){
$new = array();
while (list($k,$v) = each($arr)){
$v = trim($v);
if ($v != ''){
$new[$v] = $value;
}
}
return $new;
}
Copy after login
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/1031486.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1031486.htmlTechArticleHow to convert array values into keys in php, Convert arrays into keys in php This article explains how to convert array values in php Keying method. Share it with everyone for your reference. The details are as follows: function v...