go41

Re: simple-tags client.php Warning: array_keys() / shuffle() :: Reply by Joern

von Joern am 7. Apr. 2010 | Keine Kommentare

The solution for this ‚Warning: array_keys() [function.array-keys]: The first argument should be an array in …wp-contentpluginssimple-tagsincclient.php on line 1310‘

is for me to add some code in client.php

This code checks is the passed argument $array is an array(), if it’s not an array it sets $array = array();
The complete query to solve this error looks in my client.php around line 1310 like this:

/**
* Randomize an array and keep association
*
* @param array $array
* @return boolean
*/
function randomArray(&$array) {
// check if is array
if(!is_array($array)) {
$array = array();
}
// if not array set to array
$keys = array_keys($array);
shuffle($keys);
foreach($keys as $key) {
$new[$key] = $array[$key];
}
$array = $new;

return true;
}
I got this warning only on two of more than ten sites on one local host running php 5.2.9-0.1, no idea why just here I got this error, but now is quit!
____________________
you find me on Google+, Twitter and Facebook

(von: Joern)

Hier noch 1 weitere Ergebnisse dieses Threads:

simple-tags client.php Warning: array_keys() / shuffle()

1. Apr. 2010 (von: master)

How to solve these warnings!On some of my WordPress sites the error.log showed me errors and warnings like:Warning: array_keys() [function.array-keys]: The first argument should be an array in ...wp-contentpluginssimple-tagsincclient.php on line 13... Weiterlesen →

Autor:

Du findest mich auch auf Google+, Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


weitere forum Beiträge: