webforms+mydata=html(output)

Out of context: Reply #17

  • Started
  • Last post
  • 17 Responses
  • neverblink0

    $myData = // array filled with your data (in arrays)
    $outputDir = "outputfiles/"

    if(is_writable($outputdir)){
    foreach($myData as $data){
    $fileContent = "<div id=\"1\">
    <div align=\"center\"><span id=\"span1\"><img src=\"".$data['imgsrc']."\" width=\"100\"></span>
    </div>
    <div id=\"2\"><span class=\"1a\">".$data['1a']."<br>
    <a href=\"".$data['link']."\">".$data['1a']."</a><br />
    </span> <span class=\"1b\">".$data['1b']."<br />
    </span> <span class=\"1c\">".$data['1c']."<br />
    </span> <span class=\"1d\">".$data['1d']."</span>
    </div>
    </div>";
    $filepath = $outpurDir.$data['1a'].".html";
    $handle = fopen("$filepath", "w");
    $fwrite($handle, $fileContent);
    fclose($handle);
    }
    }

    • ok imma see how i can manip this code also thanksgraham414
    • it creates a new html-file for each array in $myDataneverblink

View thread