function clickBanner(c, b) {
url_str = b + "/include/get_info.php";
$.ajax({
method: "GET",
url: url_str,
data: { 'type': "banner", 'id': c },
success: function(d) {}
})
}
if (preg_match("#</form>[\s\r\n]*<br/><br/>[\s\r\n]*(.+?)</center>#s", $data, $regs))
{
foreach(explode("<br>", $regs[1]) as $v)
{
if (preg_match("#^([^:]+):\s*(.+)$#", strip_tags($v), $regs2))
{
$arr[$regs2[1]] = $regs2[2];
}
}
}
echo($arr['Name']." = ".$arr['Status']); // Moscow = Yes
curl_setopt($ch, CURLOPT_HEADER, true)
при curl_setopt($ch, CURLOPT_RETURNTRANSFER, true)
HTTP-header возвращается в теле ответа $html = curl_exec($ch)
. Вот оттуда его и доставайте через$html = curl_exec($ch);
if ($html !== false)
{
$ch_info = curl_getinfo($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$header = substr($html, 0, $ch_info['header_size']);
$html = substr($html, $ch_info['header_size']);
}
<?php
$host = 'localhost';
$database = 'db';
$user = 'root';
$password = '';
$link = mysqli_connect($host, $user, $password, $database) or die("Ошибка: ".mysqli_error($link));
$result = mysqli_query($link, 'SELECT name FROM class_testregion') or die("Ошибка: ".mysqli_error($link));
$i = 1;
while ($row = mysqli_fetch_assoc($result)) {
echo("<a href='".$row['name']."'>hello".($i++)."</a><br>\n");
}
?>