How can we extract string 'abc.com' from a string
"http://info@abc.com" using regular expression of PHP

Answer Posted / gaurav

you can use array split
$site_arr=split("@", "http://info@abc.com");
$site_name=$site_arr[1];

$site_name will have the value abc.com.

Is This Answer Correct ?    10 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is php explain how php works?

533


What are the main error types in php?

527


What are php variables?

522


What does == mean in php?

526


What is php form validation?

561






What backslash character will match whitespace?

572


Write a program to get lcm of two numbers using php?

520


Explain what are the two main string operators?

524


How can we connect to a mysql database from a php script?

541


Is php an object or array?

525


Why is node js better than php?

617


What is the use of print_r function in php?

523


What are the characteristics of php variables?

531


How to pass variables by references?

560


What is php resource type?

534