Sample for loading file

by sample_loading_file on December 25th, 2009
No notes
Syntax: PHP
Show lines - Hide lines - Show in textbox - Download
<?
    $data = array();
 
    $lines = file("human_miRNA.txt");
 
    for($i = 0; $i < count($lines); $i += 2) {
        $item = split("[ >\n]", $lines[$i]);
 
        $data[] = array(
            'Name' => $item[1],
            'Value' => $item[2],
            'Seq' => chop($lines[$i + 1])
        );
    }
 
    $lines = array();
?>
 
<pre>
<?
    print_r($data[5]);
    echo $data[5]['Seq'];
?>
</pre>

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS