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

hello all, I need some sample placement papers in lion bridge.. can anyone help me?

1800


Why use static methods php?

733


What is x+ mode in fopen() used for?

750


How to upload file in php?

743


How to access standard error stream in PHP?

772


how to detect a mobile device using php

789


How can you declare a constant variable in php?

774


What are Routines?

1979


What is a persistence cookie?

687


What is foreach loop in php?

744


How do you remove duplicates from an array?

834


What does explode do in php?

740


How arrays are passed through arguments?

818


What is the difference between Split and Explode in PHP?

791


What are the advantages of triggers in php?

667