R
E
S
O
U
R
C
E
S
       Home      Products & Services      Contact Us      Links


WebHatchers will design & develop your site for you.
_______________________

Website Menu Heaven: menus, buttons, etc.
_______________________

Send us your questions.
_______________________

site search by freefind
_______________________

HOME
SEO, Google, Privacy
   and Anonymity
Browser Insanity
JavaScript
Popups and Tooltips
Free Website Search
HTML Form Creator
Animation
Buttons and Menus
Counters
Captchas
Image Uploading
CSS and HTML
PHP
AJAX
XPATH
Website Poll
IM and Texting
Databases—MySQL
   or Not MySQL
Personal Status Boards
Content Management
   Systems
Article Content
   Management Systems
Website Directory
   CMS Systems
Photo Gallery CMS
Forum CMS
Blog CMS
Customer Records
   Management CMS
Address Book CMS
Private Messaging CMS
Chat Room CMS
JavaScript Charts
   and Graphs




Free Personal Status Boards (PSB™)

Free Standard Free PSB

Free PSB Pro Version

Free Social PSB

Free Social PSB Plus (with Email)

Free Business PSB

Free Business PSB Plus (with Email)

PSB demo

Social PSB demo

Business PSB demo

So what's all this PSB stuff about?

Chart comparing business status boards

PSB hosting diagram

PSB Licence Agreement



Copyright © 2002 -
MCS Investments, Inc. sitemap

PSBs, social networking, social evolution, microcommunities, personal status boards
PSBs, social networking, business personal status boards
website design, ecommerce solutions
website menus, buttons, image rotators
Ez-Architect, home design software
the magic carpet and the cement wall, children's adventure book
the squirrel valley railroad, model railroad videos, model train dvds
the deep rock railroad, model railroad videos, model train dvds

PHP Script: exploding strings into arrays when the strings have multiple character delimiters

This script is called exploding-strings-into-arrays-when-the-strings-have-multiple-character-delimiters.php


In searching the Internet, we found no evidence of a PHP script illustrating the use of multiple character delimiters when exploding PHP strings into arrays. The example at www.w3schools.com shows the use of spaces as single character delimiters to split a string into an array. No mention was made of the possibility of multiple character delimiters. So we wondered what the limits are. We tried a few experiments. The results seem to suggest that the PHP explode() function is not very fussy about what you use for a delimiter when you wish to explode strings into arrays.

In each of the three cases below, a nonstandard delimiter was used to get joe and harry into array elements. Copy it and try it out for yourself. In all three cases, joe goes into array element 0 and harry goes into array element 1.

This script is called exploding-strings-into-arrays-when-the-strings-have-multiple-character-delimiters.php


<?php
//exploding-strings-into-arrays-when-the-strings-have-multiple-character-delimiters.php

$people="joe<BR>harry";
$person = explode("<BR>", $people);
echo $person[0]."<BR>";
echo $person[1]."<BR><BR>";
echo "explode a string with a multiple character delimiter<BR><BR><BR>";

$people="joe!@#$%^&*()harry";
$person = explode("!@#$%^&*()", $people);
echo $person[0]."<BR>";
echo $person[1]."<BR><BR>";
echo "explode another string with a multiple character delimiter<BR><BR><BR>";

$people="joe went to town with a silly guy named harry";
$person = explode(" went to town with a silly guy named ", $people);
echo $person[0]."<BR>";
echo $person[1]."<BR><BR>";
echo "explode yet another string with a multiple character delimiter";

?>