All pastes #50904 Raw Edit

Something

public php v1 · immutable
#50904 ·published 2006-04-24 09:19 UTC
rendered paste body
//Function to populate a html list box with all the styles in a css file, specified as arg0-$filename blah//USGAE BLAH: <html><form><?php get_css("some.css"); ?></form></html>// here is the code blah, i used fopen, fread, blah etc... to read the style sheetfunction get_css($filename){	$flag = 0;	$style = '';	$output = '';	$size = filesize($filename);	$handle = fopen($filename, "rb");	$output .= '<select name="css">'."\r\n";	if($handle){		while (!feof($handle)) {			$byte = fread($handle,1); 			if($byte != "."){				if($flag == 1){					if($byte != "{"){						$style = $style.$byte;					} else {						$flag =0;						$style = trim($style);						$output .= '<option value="'.$style.'" class="'.$style.'">'.$style.'</option>'."\r\n";						$style = '';					}				}			} else {				$flag = 1;			}		}		fclose($handle);		$output .= '</select>'."\r\n";	}	return($output);}