ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Scripts  >>  PHP
 
 


 

 
 PHP interview questions  PHP Interview Questions
 ASP interview questions  ASP Interview Questions
 CGI Perl interview questions  CGI Perl Interview Questions
 JavaScript interview questions  JavaScript Interview Questions
 VB Script interview questions  VB Script Interview Questions
 JSP interview questions  JSP Interview Questions
 Shell Script interview questions  Shell Script Interview Questions
 Python interview questions  Python Interview Questions
 Tcl interview questions  Tcl Interview Questions
 Awk interview questions  Awk Interview Questions
 AJAX interview questions  AJAX Interview Questions
 Ruby on Rails interview questions  Ruby on Rails Interview Questions
 Scripts AllOther interview questions  Scripts AllOther Interview Questions
Question
How can we extract string ‘abc.com ‘ from a string
info@abc.com" target="_blank">http://info@abc.com using
regular expression of php?
 Question Submitted By :: Rajan Vardawaj
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How can we extract string ‘abc.com ‘ from a string info@abc.com" target="_blank">http://info@abc.com using regular expression of php?
Answer
# 1
We can use the preg_match() function with “/.*@(.*)$/” as
the regular expression pattern. For example:
preg_match(”/.*@(.*)$/”,”info@abc.com”,$data"
target="_blank">http://info@abc.com”,$data); echo $data[1];
 
Is This Answer Correct ?    0 Yes 0 No
Rajan Vardawaj
 
  Re: How can we extract string ‘abc.com ‘ from a string info@abc.com" target="_blank">http://info@abc.com using regular expression of php?
Answer
# 2
$string1="info@abc.com";
$string2=split("@",$string1);
print_r($string2);

this code print the string as abc.com
 
Is This Answer Correct ?    6 Yes 0 No
Simlu_irtt
 
 
 
  Re: How can we extract string ‘abc.com ‘ from a string info@abc.com" target="_blank">http://info@abc.com using regular expression of php?
Answer
# 3
$string1="info@abc.com";
$string2=split("@",$string1);
print_r($string2);

this code print the string as abc.com
 
Is This Answer Correct ?    2 Yes 0 No
Simlu_irtt
 

 
 
 
Other PHP Interview Questions
 
  Question Asked @ Answers
 
What is MIME?  2
What are the limitations or drawbacks of PHP ? iDream2
How can we know that a session is started or not? Rushmore-Consultancy3
How can you "tell" MySQL server to cache a query?  2
How can we do user authentication without using session/cookies ? For ex:- From page1 accepts user name and password and need to check in all other pages whether the user has logged in or not TCS6
What types of images that PHP supports?  2
How can I execute a PHP script using command line? Sify3
How can i send a HTML file to mail account.  2
how to run PHP in command line? Xtreeme7
what is the current salary package in India for a PHP & MySQL programmer who has 3 years experience ABC56
List out the predefined classes in PHP?  7
Who is the father of PHP and explain the changes in PHP versions? iMark-Group6
what is PHP accelerator ?  2
Is it possible to get the screen resolution and like with php?  1
How many ways we can pass the variable through the navigation between the pages?  6
How to get path of php.ini with a php script?  1
Explain about Type Juggling in PHP?  1
Design a class that should always return a single object ? NIIT3
How can we extract string 'abc.com' from a string "http://info@abc.com" using regular expression of PHP Wipro6
How can we create a database using PHP and mysql? Rushmore-Consultancy3
 
For more PHP Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com