Include php code within echo from a random text
- by lisa
I want to display a php code at random and so for I have
<?php
// load the file that contain thecode
$adfile = "code.txt";
$ads = array();
// one line per code
$fh = fopen($adfile, "r");
while(!feof($fh)) {
$line = fgets($fh, 10240);
$line = trim($line);
if($line != "") {
$ads[] = $line;
}
}
// randomly pick an code
$num =…