WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Pull deliniated text strings into a "SELECT" statement in a form.
Categories : HTML and PHP, PHP, Strings Update Picture
Darrell Brogdon
Date : Jun 10th 1998
Grade : 1 of 5 (graded 1 times)
Viewed : 4284
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Darrell Brogdon
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<?

/*
$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