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 : class that splits up a string into segments given any amount of delimters. Usefull for parsing input querys from a form field.
Categories : PHP Classes, Strings Update Picture
Ed Williams
Date : May 01st 1999
Grade : Be the 1st to grade this Code Example
Viewed : 4174
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Ed Williams
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<?php

/******************************************************************
class Exploder
*******************************************************************

Purpose : split a string up into segments given delimiter(s)
Usage : pizza = "slice1:slice2|slice3:|slice4";
expl = new Exploder(array(":","|"), pizza);
slices = expl->GetSegments();

*******************************************************************/

class Exploder {

var $m_segments;

function Exploder($tokens, $string) {

$string = stripslashes($string);
$start = true;

for ($i=0; $i < strlen($string); $i++) {

// check for token
for ($t=0; $t < count($tokens); $t++) {
if ($string[$i] == $tokens[$t]) {
if ($start) {
// save segment
$this->m_segments[] = $segment;
unset($segment);
}
$start = false;
break;
}
}

// check if token found
if ($t == count($tokens))
$start = true;

// append character to segment
if ($start)
$segment .= $string[$i];
}
if ($start)
$this->m_segments[] = $segment;
}
function GetSegments() {
return $this->m_segments;
}
function GetNumber() {
return count($this->m_segments);
}
};
?>



PHP5 URL Object
Categories : PHP, PHP Classes, URLs, Strings
Class TStringList include some metods from class TStringList implemented in INPRISE/BORLAND-DELPHI
Categories : PHP Classes, PHP, Strings
STR - a Perl-like string manipulator class - The str class provides 4 perl-like methods for manipulating strings and other scalar variables.
Categories : PHP, PHP Classes, Perl, Strings
Compare two texts and display a block of text with the differences between them.
Categories : PHP, PHP Classes, Filesystem, Strings, Arrays
Filter - A simple class that lets you use multiple functions to create custom filters.
Categories : PHP, PHP Classes, Strings
file class , uploade file , download file already uploaded on another website
Categories : PHP, PHP Classes, Filesystem, Web Services
Authorize.net AIM Interface Class v1.0.0
Categories : PHP, PHP Classes, Ecommerce, Payment Gateways
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
crop and resize image class using gd library function
Categories : PHP, PHP Classes, GD image library, Graphics
Excel class in PHP
Categories : PHP, PHP Classes, Excel
News management class
Categories : PHP, PHP Classes, Beginner Guides
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)
Expose - PHP template engine, supports server and client-sided caching,a plugin system, multiple languages, template script language is based on PHP itself.
Categories : PHP, PHP Classes, Templates, Complete Programs
Simple Template Class/Example
Categories : PHP, Templates, PHP Classes
Allows you to parse a deliniated string and put the individual fields in a SELECT option in a form
Categories : HTML, PHP, Strings