$content = '<iframe src="test.txt">'; preg_match('/<iframe.*src="(.*)".*>/', $content, $matches); var_dump($matches)