GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  PHP
Go To First  |  Previous Question  |  Next Question 
 PHP  |  Question 25 of 74    Print  
What is the difference between explode and split?
Split - Splits string into array by regular expression.
Explode - Split a string by string

Hope this helps



  
Total Answers and Comments: 3 Last Update: July 19, 2008     Asked by: Paddy 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Qazi
 
In Split You can use regular Expression
like

split('[/.-]', $string);


Above answer was rated as good by the following members:
saradavid16
November 30, 2006 01:07:02   #1  
Balakrishnan        

RE: What is the difference between explode and split?
hi explode function split a string by string. for example explode( and india and pakistan and srilanka ); this function will return an array it contanis india pakistan srilanka. split function also spliting the string by regular expressions for example split( : india : pakistan : srilanka ); this function will return an array it contanis india pakistan srilanka.
 
Is this answer useful? Yes | No
January 20, 2007 01:27:32   #2  
kannan        

RE: What is the difference between explode and split?

hi

the difference is:

in split we can use regular expression in the search field

wheras in explode we cant.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
March 21, 2007 03:14:48   #3  
Qazi        

RE: What is the difference between explode and split?
In Split You can use regular Expression
like

split('[/.-]' $string);

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape