1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
$url ='http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/fr/details?c=uk&cs=frbsdt1&l=uk&s=bsd&ServiceTag=GPYRTB1';
//echo $url;
$match = array();
$outputdata = array();
$FILE = fopen($url, 'r');
while ($line = fread($FILE, 1024)) {
if (preg_match('/System Type:.*?/i', $line, $match3,PREG_OFFSET_CAPTURE)) {
var_dump($match3);
$text=$match3[0][0];
echo $text;
$marqueurDebut = "System Type:";
$debut = strpos( $text, $marqueurDebut ) + strlen( $marqueurDebut );
$marqueurFin = "Ship Date:";
$fin = strpos( $text, $marqueurFin );
$systemtype = substr( $text, $debut, $fin - $debut );
echo $systemtype;
preg_match('/Ship Date:.*?(\d{2}\/\d{2}\/\d{4})/i', $text, $match2,PREG_OFFSET_CAPTURE);
//$shipdate= $match2[1][0];
$outputdata ["ShipDate"]= codeDate($match2[1][0]);
$outputdata ["SystemType"]= strip_tags ($systemtype);
//echo '<br>'.$shipdate.'-'.$systemtype.'<br>';
} |
Partager