H I O X INDIA
Online PHP Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

PHP Topics
Introduction
Syntax
Data Types
Variables
Operators
Control Structures
Functions
Pre-defined Function
Calendar Functions
Date and Time
Array Functions
Array Functions List1
Array Functions List2
Math Functions
PHP Mysql Functions
File Handling
Error Handling
DB Size
PHP Mail
String Tokens
String Functions
String Functions List1
String Functions List2
Session Functions
Cookies Functions
Form Variables
Running PHP from JS
Array To JS
Array to PHP
Encryption
Common Header
Ask Your Doubts
More about PHP
Feedback




String Tokens / Splitting string


Topic

How can I split the string using php?



Explanation



Let us consider we get a value from a post actionone,two,three
i.e: $ss = $_POST['arv'];

Now using the php method explode() we will convert the string in to a array object
explode(seperator,string);
i.e. $tok = explode(',',$ss);

so we have got a string array. Now we print the array using print_r() method. This method prints the array in string format.

print_r($tok);


The result
Array ( [0] => one [1] => two [2] => three )





privacypolicy     licence     sitemap
(c) copyright, 2004 hioxindia.com