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

How to declare an array in php?

541


What is the difference between explode and split?

493


Is empty in php?

545


What is trim codeigniter?

537


Tell me what does pear stands for?

552






Is php used anymore?

525


What is a helper function?

543


Explain what does $_server means?

579


How many keywords are there in php?

618


How long should a session last?

510


Differentiate between php5 and php7?

629


What is session in php w3schools?

558


What is the super method?

564


What is the purpose of using php?

512


Where php language is used?

529