Witam, mam sobie taki kod :
<?
$char=$_GET['char'];
$content = file_get_contents("http://maplestory.nexon.net/Rankings/OverallRanking.aspx?type=overall&s=l&pageIndex=1&key=".$char."&search=true"); $pattern = '@<td\sclass="ac">([0-9]*)\s*</td>\s*<td\sclass="avatar"><img\s*src=\'([^"]*)\'\salt=""\sclass="pet"/><img\s*src=\'([^"]*)\'\salt=""/></td>\s*<td\sclass="char-name">([^<]*)'.$char.'</td>\s*<td\sclass="ac"><a\sclass="([^"]*)"\s*href="([^"]*)">[^<]*</a></td>\s*<td\sclass="ac"><img\ssrc=\'\s*([^"]*)\'\s*alt="([^"]*)"\s*title="[^"]*"\s/></td>\s*<td\sclass="level-move">\s*<div\sstyle="display:block">\s*([0-9]*)<br/>\(([^)]*)\)<br\s/>[\S\s]*</div>\s*<div\sstyle="display:none">\s*([0-9]*)\s*</div>\s*<div\sstyle="display:none">\s*(-?[0-9]*)\s*</div>@Usi';
$regexSuccess = preg_match($pattern, $content, $matches); $nickname=str_replace((string
)$matches[1], "", $nickname); $nickname=str_replace((string
)$matches[2], "", $nickname); $nickname=str_replace((string
)$matches[3], "", $nickname); $nickname=str_replace((string
)$matches[4], "", $nickname); $nickname=str_replace((string
)$matches[5], "", $nickname); $nickname=str_replace((string
)$matches[6], "", $nickname); $nickname=str_replace((string
)$matches[7], "", $nickname); $nickname=str_replace((string
)$matches[8], "", $nickname); $nickname=str_replace((string
)$matches[9], "", $nickname); $nickname=str_replace("(".(string
)$matches[10].")", "", $nickname); $nickname=str_replace((string
)$matches[11], "", $nickname); $nickname=str_replace((string
)$matches[12], "", $nickname);
$avatar = "<img src=".$matches[3].">";
$pet= "<img src=".$matches[2].">";
$world = $matches[5];
$job = $matches[7];
$lvl = $matches[9];
$exp = $matches[10];
$rank = $matches[1];
$rankmove = $matches[12];
function procent($x, $y) {
$result = ($x/$y)*100;
return $result;
}
$expForNext[1]=15;
$expForNext[2]=34;
$expForNext[3]=57;
...
$expForNext[196]=927931469;
$expForNext[197]=983607358;
$expForNext[198]=1042623799;
$expForNext[199]=1105181227;
$expProc = procent($exp, $expForNext[$lvl]);
echo "Nick: ", $nickname, "<br>","Avatar: ", $avatar, $pet, "<br>","Pozycja: ", $rank, "<br>","Przesuniecie w rankingu: ", $rankmove, "<br>","Poziom dosw.: ", $lvl, "<br>","Exp: ", $exp;
?>
Do tego mam tło o wymiarach 350x150, i chciałbym umieścić zmienne
$avatar
$pet
$world
$job
$lvl
$exp
$rank
$rankmove
na właśnie owym tle.
Chciałem do tego użyć funkcji imagecreatefromstring, ale nie mam pojęcia jak sie do tego zabrać. Proszę o jakieś nakierowanie na rozwiązanie ewentualnie na inną funkcję.
Z góry dziękuje oraz pozdrawiam

P.S. Częsć kodu z wyrażeniem regularnym napisał i wytłumaczył mi kolega informatyk, ale nie chce mu zawracać już więcej głowy, więc pisze tu