Explode Function - RMB Scripting
You appear not have have an account with us, Click HERE to register an account...
RMB Scripting
Navigation
  Home
  Contact
  FAQ
  Forum
  Topsites
  Members
  Competitions
  Affiliates
Downloads
  Templates
  Scripts
  Fonts
  Image Sets
  Software
  Other
 
Tutorials
  .htaccess
  Photoshop
  C/C++
  CSS
  Macromedia Flash
  MySQL
  PHP
  PHP - User System
  HTML
  Javascript
  Macintosh
  Macromedia Fireworks
  Visual Basic
  Visual C#
  Windows
  Other
 
Latest Tutorials
Liveprinter For Mac
Scrollbar Coloring
Connect to a MySQL Server
Enabling Windows Dream...
Make Vista 60% faster,...
Latest Comments
User System (Part 1)
User System (Part 1)
User System (Part 1)
Limit username restric...
Whos Online
Stats
Total Members: 468 [153]
Total Tutorials: 241
Newsest User: Lauraa
Todays Unique Hits: 114
Users Online: 2
MOD-Shadow, new2old
5 Guests
Poll
Do you like this poll?
Yes
Maybe
No
Main Content
Tutorial: Explode Function By DanielXP
The explode funtion gets a variable in PHP and splits it into sections at a set point.

Example 1: ~ Date Of Birth   
PHP:
<?php
$mydob 
"01/04/1990"//Setting the DOB variable
$dob explode("/"$mydob); //splits the data between a /
$day $dob[0]; //The first in the series is the day of birth
$month $dob[1]; //Second is the month
$year $dob[2]; //Third is the year of birth
?>

The above splits the data at a '/' section this could be set as any thing such as : which will mean the new date of birth will be 01:04:1990

Example 2: ~ Variables   
PHP:
<?php
$data 
"DanielXP:mYPaSS:daniel@rmb-scripting.com"//sets the data. I have set this as a username, password and email
list($username$password$email) = explode(":"$data); //This lists and exploads the variable and sets there new variables
echo "Welcome $username - You email is $email";
?>


I hope you find a use for this tutorial.
Difficulty: Moderate
Views: 724
Rating:
Comments
There are currently no comments for this tutorial.
Notice:
Remember to post long codes on our pastbin! - (http://rmb.pastebin.com/)
Add Comment
You must be logged in to post a comment.
Good Evening Guest
Username: 
Password: 
Remember Username
Links
RMB Arcade
GangstaMania
Free Domains
Free Games
Alien Design Toplist
Affiliates