Note that there are some explanatory texts on larger screens.

plurals
  1. POConverting data with commas to variables in JavaScript
    primarykey
    data
    text
    <p>I have a row of a lines that is like this, these are the lines of html output of a php code that comes from a search.</p> <p>here is the browser output page source (not the server source)</p> <pre><code>**&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta`enter code here` content="text/html; charset=windows-1252" http-equiv="content-type"&gt; &lt;title&gt;my page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div style="text-align: center;"&gt; &lt;title&gt;My Page&lt;/title&gt; &lt;form name="myform" action="systemmonitor.php" method="GET"&gt; &lt;div align="center"&gt;My page&lt;br&gt; &lt;br&gt; &lt;input name="sea1" placeholder="customtext" size="25" type="text"&gt; &lt;br&gt; &lt;br&gt; &lt;input name="sea2" placeholder="customtext" size="25" type="text"&gt; &lt;br&gt; &lt;br&gt; &lt;input name="sea" value="submit" type="submit"&gt;&lt;br&gt; &lt;br&gt; data00,data01,data02,data03, , , and so on data10,data11,data12,data13, , , and so on data20,data21,data22,data23, , , and so on (and so on in rows) &lt;br&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>here is the browser server source (php)</p> <pre><code> **&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta`enter code here` content="text/html; charset=windows-1252" http-equiv="content-type"&gt; &lt;title&gt;my page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div style="text-align: center;"&gt; &lt;title&gt;My Page&lt;/title&gt; &lt;form name="myform" action="systemmonitor.php" method="GET"&gt; &lt;div align="center"&gt;My page&lt;br&gt; &lt;br&gt; &lt;input name="sea1" placeholder="customtext" size="25" type="text"&gt; &lt;br&gt; &lt;br&gt; &lt;input name="sea2" placeholder="customtext" size="25" type="text"&gt; &lt;br&gt; &lt;br&gt; &lt;input name="sea" value="submit" type="submit"&gt;&lt;br&gt; &lt;br&gt; &lt;?php $searchthis = $_GET["sea1"]; $matches = array(); $handle = @fopen("sources.csv", "r"); if ($handle) { while (!feof($handle)) { $buffer = fgets($handle); if(strpos($buffer, $searchthis) !== FALSE) $matches[] = $buffer; } fclose($handle); } //show results: $myString = implode( ', ', $matches ); print_r($myString); ?&gt;&lt;br&gt; &lt;br&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Now, in the real page where is data0,data1,data2... is a php code that make this stuff from the html forms above, now the php output i dont what to see as is, but i want to convert to variables, and show only the variables where i want to, something likes this its ok:</p> <pre><code>var parsed[0][0]=data00; var parsed[0][1]=data01; var parsed[0][2]=data02; var parsed[0][3]=data03; var parsed[1][0]=data10; </code></pre> <p><br> 0,X (X is the number of the colume) 1,X (X is the number of the row) <br> and then i show only the data where I want. for example i will put this code somewhere in the page: </p> <pre><code>document.write(parsed[0][3]); </code></pre> <p>the data00 data01 is just a custom data that php will make from before.</p> <p>how I can do this convert? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload