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 difference between python and php?

519


What is json php?

538


What is env in laravel?

541


How should a model be structured in mvc?

529


How does php server work?

543






Does php have future?

584


Php says that an array is an ordered map. But how the values are ordered in an array?

602


What are the advantages of stored procedures?

554


What is the best practice for running mysql queries in php? Consider the risk of sql injection.

558


Explain the difference b/w static and dynamic websites?

499


What is session expiry?

540


Can php run on windows server?

531


What is variable declaration?

499


How to create a mysql connection?

543


Tell me what does $_env means?

536