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 uniqid php?

774


Explain what are the two main string operators?

731


What is the value for this auto incremented field user_pri_id?

717


How to access a specific character in a string using php?

768


What changes I have to do in php.ini file for file uploading?

780


Is laravel an oop?

699


How long does a php session last for?

800


Is it more secure to use cookies to trfer session ids?

737


Is php case sensitive?

707


What is the difference between core php and php?

720


How to pass variables by references?

747


How to turn on the session support?

843


When should you use a stored procedure?

725


What is difference between echo and print in php?

705


Is null empty php?

755