- substr: documentation ( source)
- stripos: documentation ( source)
<?php
$text = 'tehdgsd f fs fsddf sdf http://mail.ru?dsdfll fdsfsd';
if( ($pos = stripos($text, 'http://')) || ($pos = stripos($text, 'https://')) )
{
echo $pos;
echo substr($text, $pos);
}