PHP kood:
$regexp = "http(s)?://.[A-Za-z0-9-]+.(png|jp(e)?g|gif)";
preg_match_all("/$regexp/", $input, $matches, PREG_SET_ORDER)
kogu kood:
PHP kood:
<?php
$url = "game.css";
$input = @file_get_contents($url) or die("Could not access file: $url");
$regexp = "http(s)?://.[A-Za-z0-9-]+.(png|jp(e)?g|gif)";
if(preg_match_all("/$regexp/", $input, $matches, PREG_SET_ORDER)) {
foreach($matches as $match) {
echo $match[1]; //ükskõik mis numbri ma 1 asemel panen, ei anna mulle tulemust.
}
}
?>
Mis mul valesti on?