I have a text file (.txt) that contains a list of values such as given below:
Code: Select all
LotusNotesAdmin
NAS_Support
Network_ETS_Support
Network_Support
Restore_SupportExample:
Code: Select all
<option>HPOVO_Support</option>
<option>Backup_Support</option>
Code: Select all
<?php
$file = "text.txt";
$buffer = "";
$fp = fopen( $file, 'r' );
while ( !feof ( $fp) ) {
$buffer = fgets( $fp );
echo "<option>".$buffer."</option>";
}
?>Code: Select all
<option>Backup_ETS_Support
</option><option>Backup_Support
</option><option>DC_ETS_Support
</option><option>DC_SupportI used stream_get_line but that would require $Length without which the script would fall in an indefinite loop!
Any ideas?