title: My Array variable will return only the first character
body: <p>Good day! My problem is not common here... there are plenty questions similar to my problem but as I compare one is identical but he did not declare his/her variable like this: <code>$page = array();</code>, but mine I declare it but still it return the first character of the value.</p>
  
  <p>Source: <a href="https://stackoverflow.com/a/3605800/7514462">PHP String in Array Only Returns First Character
  </a></p>
  
  <p>Here's my code:</p>
  
  <p>main php file</p>
  
  <p>Script:</p>
  
  <pre><code>var saveStudRegInfo=[[],[]];
  
  studInfoLN = document.getElementById('studRegLN').value;
  studInfoFN = document.getElementById('studRegFN').value;
  studInfoMN = document.getElementById('studRegMN').value;
  studInfoGender = document.getElementById('studRegGender').value;
  studInfoCourse = document.getElementById('studRegCourse').value;
  studInfoID = document.getElementById('studRegID').value;
  studInfoRFID = document.getElementById('studRegRFID').value;
  
  saveStudRegInfo[0][0] = studInfoLN;
  saveStudRegInfo[0][1] = studInfoFN;
  saveStudRegInfo[0][2] = studInfoMN;
  saveStudRegInfo[0][3] = studInfoGender;
  saveStudRegInfo[0][4] = studInfoCourse;
  saveStudRegInfo[0][5] = Number(studInfoID);
  saveStudRegInfo[0][6] = studInfoRFID;
  saveStudRegInfo[0][7] = studPicFilename;
  
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
     if (this.readyState == 4 &amp;&amp; this.status == 200) {
       document.getElementById("saveWorkSched").innerHTML = this.responseText;
     }
  };
  
  xhttp.open("GET", "ajax/saveSAWorkSched.php?studRegInfo="+saveStudRegInfo+"&amp;schedList="+getSAWorkSched+"&amp;studInfoID="+studInfoID, true);
  xhttp.send();
  </code></pre>
  
  <p>saveSAWorkSched.php</p>
  
  <pre><code>$studPerInfo = array();
  $studPerInfo = $_GET['studRegInfo'];
  $studLN=$studFN=$studMN=$studGender=$studCourse=$studID=$studRFID=$studPicFilename='';
  
  if (!empty($studPerInfo)) {
      $studLN = $studPerInfo[0];
      $studFN = $studPerInfo[1];
      $studMN = $studPerInfo[2];
      $studGender = $studPerInfo[3];
      $studCourse = $studPerInfo[4];
      $studID = (int)$studPerInfo[5];
      $studRFID = $studPerInfo[6];
      $studPicFilename = $studPerInfo[7];
  }
  
  echo var_dump($studLN);
  </code></pre>
  
  <p>The Result will be:</p>
  
  <pre><code>string(1) "d"
  </code></pre>
  
  <p>Here's the <code>var_dump</code> for the whole array (<code>$studPerInfo</code>).</p>
  
  <pre><code>string(74) "Dela Cruz,Juan,Masipag,male,BSInfoTech,1234567890,2342342342342,dummy.jpg,"
  </code></pre>