Home  >  Q&A  >  body text

How to generate a set of data into an array key in php, and then copy the value to this key

Example

Have $a = 4,5,6

I want to get

$b = array(

4 => 1,

        5 => 1,

        6 => 1

          );

Please give me some advice

xingzhixingzhi1453 days ago825

reply all(1)I'll reply

  • 灭绝师太

    灭绝师太2020-11-09 09:52:09

    PHP array_fill_keys(),extract() function

    reply
    2
  • Cancelreply