|
|
|
<?
/*
$string: the deliniated string you wish to parse and place as an option in your SELECT statement
$delimiter: the delimiter you use to separated the fields in your string. Commas (,)
or Pipes (|) are common delimiters.
*/
Function select_parse($string, $delimiter) {
$options = split( "[$delimiter]+", $string );
for( $i = 0; $options[$i]; $i++ ) {
echo "<option> $options[$i]\n";
}
}
$strText = "One,Two,Three,Four";
?>
<FORM>
<SELECT NAME="test">
<? select_parse($strText, ","); ?>
</SELECT>
</FORM>
|
|
| Query2Report : Generating Html, Pdf and Csv Reports from SQL Query Categories : PHP, PHP, HTML, PDF, Excel | | | A simple class with some HTML output functions that would come in handy for consistent page layout etc. Categories : PHP, PHP Classes, HTML and PHP, HTML, Navigation | | | Avoiding or Detecting high bit characters in a string. Useful when you want to create a valid RSS feed Categories : PHP, Strings, Unicode, Regexps, Rich Site Summary (RSS) | | | Parses HTTP_USER_AGENT so that you can customize your site to different browsers Categories : HTML, PHP, Complete Programs | | | Using data from a string. Categories : PHP, Strings, CURL | | | function textwrap will wrap text to any desired width using <BR>\n as the default line break.
Default wrap width is 80 columns.
Categories : Strings, HTML and PHP, PHP | | | BBCode Formatting String Categories : PHP, HTML, Regexps, Arrays | | | Display Slashdot headers on your own site Categories : HTML and PHP, HTML, PHP | | | I need a trim function/regexp that will trim all " " from the ends of a string. Categories : Regexps, PHP, Strings | | | color codes for positive and negative numbers Categories : PHP, MySQL, Databases, HTML | | | Builds JavaScript that updates the contents of one selector based on another. Categories : HTML, Java Script, PHP, Complete Programs, General | | | mysql_escape_string Categories : PHP, MySQL, Databases, Strings | | | FormWizard reads a mysql table and generates automatically
a html formular in a html-table Categories : PHP, MySQL, HTML | | | Look for the *position* of the first occurence of string2
in string1, beginning at position start.
Categories : Complete Programs, PHP, Strings | | | Browser Detecor Class Categories : PHP Classes, PHP, HTML | |
|
|
|