Q:

Get specific keys & values from php data file into js

I'm trying to figure out how to return just the fieldName key & values from a php data file and be able to call them individually. 
Sample of returned info from network output:
"info":"<?php\r\n$dataset->tableName = \"mytable\";\r\n....$dataset->fieldName[0] = \"id\";\r\n$dataset->fieldType[0] = \"int\";...

My php file to output the info:
$dbfile = "path to php data file";
$info = file_get_contents($dbfile);

returnSuccess($info);
function returnSuccess($info) {
  $data=array();
  $data['success'] = true;
  $data['info'] = $info;
  echo json_encode($data);
  exit;
}

I can see the $info as one big string when returned in network data as seen in sample above.   Is there a way to get each of the fieldName keys & values? 
I would like to back in the js, be able to call indiv fieldNames:
.done (function(data) {
  if (data.success == true) {
   console.log('1stfieldName: ' + data.info.fieldName[0]);

A:

Got a solution by adding require_once to pull in datafile & using for loop to get the fieldnames

