How can we extract string ?allinterview.com ? from a string
?http://info@allinterview.com? using regular expression of PHP?

Answers were Sorted based on User's Feedback



How can we extract string ?allinterview.com ? from a string ?http://info@allinterview.com? using re..

Answer / pinky

if (ereg("allinterview.com",
"http://info@allinterview.com", $temp) )

print $temp[0];

Is This Answer Correct ?    4 Yes 1 No

How can we extract string ?allinterview.com ? from a string ?http://info@allinterview.com? using re..

Answer / vipul dalwala

$string = "http://info@allinterview.com";
preg_match(@^(?:http://)?([^@]+)(.*)$@i', $string,
$matches);

print $matches[2]; // allinterview.com

Is This Answer Correct ?    3 Yes 2 No

How can we extract string ?allinterview.com ? from a string ?http://info@allinterview.com? using re..

Answer / raj

$text = "http://info@allinterview.com";
preg_match('|.*@([^?]*)|', $text, $output);
echo $output[1];

Is This Answer Correct ?    1 Yes 0 No

How can we extract string ?allinterview.com ? from a string ?http://info@allinterview.com? using re..

Answer / kichu

Using explode function

Is This Answer Correct ?    1 Yes 4 No

How can we extract string ?allinterview.com ? from a string ?http://info@allinterview.com? using re..

Answer / jcb.chl

<?
$str = substr('http://info@allinterview.com?',12);
echo $str;
?>

output:

allinterview.com?

Is This Answer Correct ?    2 Yes 6 No

How can we extract string ?allinterview.com ? from a string ?http://info@allinterview.com? using re..

Answer / iiiiiiii

iiiiiiii

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More PHP Interview Questions

How to convert strings to numbers in php?

0 Answers  


Tell us how to redirect a page in php?

0 Answers  


What is advanced php programming?

0 Answers  


What is data type in php?

0 Answers  


How to pass variables by references?

0 Answers  


What are the current versions of apache, PHP, and mysql?

21 Answers  


what is abstrac class? why it is use?

5 Answers  


Tell me how can we determine whether a php variable is an instantiated object of a certain class?

0 Answers  


What are the functions for imap?

0 Answers  


What does $_server mean?

0 Answers  


hello experts good morning to everyone ! at present am now learning LAMP course sir( linux, apache,mysql and php) after finishing this course can i create my own website without investment is it possible ? please can any one tell sir and also tell me how can i upload my project after finishing the project in internet ? please tell the ways sir please send ur valuable suggestions to kiranpulsar2007@gmail.com

2 Answers  


Which operator is used to combine string values in php?

0 Answers  


Categories