title: Warning Illegal string offset in PHP
body: <p>I have this chunk of PHP code which is giving me the error:</p>
  
  <blockquote>
    <p>Warning: Illegal string offset 'mod_modulecode' in C:\xampp\htdocs\MP\multi\functions.php on line 29</p>
  </blockquote>
  
  <p>This is the code that the warning is relating to:</p>
  
  <pre><code>function set_rights($menus, $menuRights) {
      $data = array();
      for ($i = 0, $c = count($menus); $i &lt; $c; $i++) {
          $row = array();
          for ($j = 0, $c2 = count($menuRights); $j &lt; $c2; $j++) {
              if ($menuRights[$j]["rr_modulecode"] == $menus[$i]["mod_modulecode"]) {
                  if (authorize($menuRights[$j]["rr_create"]) || authorize($menuRights[$j]["rr_edit"]) ||
                          authorize($menuRights[$j]["rr_delete"]) || authorize($menuRights[$j]["rr_view"])
                  ) {...................'
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>