PHP array_count_values returning an empty array -


Maybe I'm seeing something very obvious but this code does not work:

  & Lt; Pre & gt; & Lt ;? Php print_r (($ progress)); ? & Gt; & Lt ;? Php print_r (array_count_values ​​($ progress)); ? & Gt; & Lt; / Pre & gt;  

Outlook is:

  array ([0] => 1 [1] => 1 [2] = & gt; 1 [3] => 1 [4] => 1 [5] => 1 [6] => 1) Array ()  

What's here That's wrong? Why is empty_count_values ​​returning an empty array?

array_count_values ​​ works with only / Code> and integer values ​​my guess: you're accumulating booleans inside $ progress . You can put them at int before adding them to $ progress .


Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -