You are here

public static function EasyRdf_Utils::isAssociativeArray in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/easyrdf/easyrdf/lib/EasyRdf/Utils.php \EasyRdf_Utils::isAssociativeArray()

Check if something is an associative array

Note: this method only checks the key of the first value in the array.

Parameters

mixed $param The variable to check:

Return value

bool true if the variable is an associative array

1 call to EasyRdf_Utils::isAssociativeArray()
EasyRdf_Literal::create in vendor/easyrdf/easyrdf/lib/EasyRdf/Literal.php
Create a new literal object

File

vendor/easyrdf/easyrdf/lib/EasyRdf/Utils.php, line 78

Class

EasyRdf_Utils
Class containing static utility functions

Code

public static function isAssociativeArray($param) {
  if (is_array($param)) {
    $keys = array_keys($param);
    if ($keys[0] === 0) {
      return false;
    }
    else {
      return true;
    }
  }
  else {
    return false;
  }
}