- substr: documentation ( source)
- strpos: documentation ( source)
- strrev: documentation ( source)
<?php
//$homepage = FILE_GET_CONTENTS('WWW.ROGERS.COM');
$homepage = true;
if(!$homepage){
die("FILE_GET_CONTENTS_ERROR");
}
$rogers = "tttttttt<a href=\"/business/BSS.portal?_nfpb=true&_st=&_windowLabel=header_portlet&_urlType=action&wlpheader_portlet_action=changeLanguage&lang=fr\">francais</a>tttttttttt";
echo($rogers);
echo("\n");
$pos = strpos($rogers, "francais");
if($pos === FALSE){
die("STRPOS_ERROR");
}
$rogers = substr($rogers, 0, $pos);
if(!$rogers){
die("SUBSTR_ERROR");
}
$rogers = strrev($rogers);
$pos = strpos($rogers, "a<");
if($pos === FALSE){
die("STRPOS_ERROR");
}
$rogers = substr($rogers, 0, $pos);
if(!$rogers){
die("SUBSTR_ERROR");
}
$rogers = strrev($rogers);
echo($rogers);
echo("\n");
$len = strlen($rogers);
$rogers = substr($rogers, 6, $len - 2);
if(!$rogers){
die("SUBSTR_ERROR");
}
echo($rogers);
echo("\n");