|
|
|
<?
/*
$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> |
|
| 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 | | | Customizable encoding and decoding strings with security. Categories : PHP, Strings, HTML and PHP | | | Produces browser-safe strings while preserving HTML tags. Categories : Strings, HTTP, PHP, HTML and PHP | | | Text Wrapping Categories : PHP, HTML and PHP, Strings | | | string justification align center text Categories : Strings, PHP, HTML and PHP | | | PHP3: Formmail. Just a cgi formmail, but than in PHP. It is easy to use! Categories : HTML and PHP, Email, PHP, Perl, HTML and PHP | | | 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 | | | Simple script to passing persistent and growing array between recalls of one page (manipulate little stack). Categories : Arrays, Global Variables, PHP, HTML and PHP, Variables | | | Calendar using Date function Categories : HTML and PHP, PHP, Date Time, Calendar | | | phpCards - PHP/mySQL postcard script with web based admin to add, edit, and delete cards and categories. Very easy to install. Categories : PHP, Complete Programs, HTML and PHP, MySQL | | | 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) | | | Select with current month Categories : PHP, HTML and PHP, Date Time, Arrays | | | PHP4 session helper HTML file.
Categories : PHP, Java Script, HTML and PHP, Sessions | | | html split bar used to split in multiple pages a database result Categories : HTML and PHP, Databases, MySQL, PHP | | | Smart Counter - This little script is a plain and simple hit counter that uses cookies to determine whether or not the visitor has already been counted. Categories : Cookies, HTML and PHP, PHP | |
|
|
|