<?
/*
$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 string justification align center text Categories : Strings , PHP , HTML and PHP Text Wrapping Categories : PHP , HTML and PHP , Strings Produces browser-safe strings while preserving HTML tags. Categories : Strings , HTTP , 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 Customizable encoding and decoding strings with security. Categories : PHP , Strings , HTML and PHP Parse string to find sub-string between two arbitrary strings Categories : PHP , Strings , HTML and PHP , Arrays Function to do live population of HTML's <Select> tag from a Table Categories : PHP , MySQL , HTML and PHP , Databases explode() and SQL blobs Categories : General SQL , Strings , PHP , Databases Automatically printing the contents of an sql table in MySQL. Categories : MySQL , PHP , HTML and PHP , Databases Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET Categories : Algorithms , HTML and PHP , PHP , Variables Alternating background color for HTML table rows Categories : PHP , Databases , MySQL , HTML and PHP Create a link to check the accessibility of a PHP page using Bobby. Categories : PHP , HTML and PHP Random Image Display Categories : PHP , Filesystem , Graphics , HTML and PHP webcam cam view image ispy browser independant Categories : Graphics , HTML , HTML and PHP , PHP