<?php
function extract_host($url)
{
if (preg_match('~^https?://(?:www\.)?([^/]+)~', $url, $m)) {
return $m[1];
}
return null;
}
var_dump(extract_host('http://example.com/go/d5863567e7544ae94c5c9342837dbbf8'));
var_dump(extract_host('http://www.example.com/go/d5863567e7544ae94c5c9342837dbbf8'));
string(11) "example.com"
string(11) "example.com"
zend_extension=xdebug.so
xdebug.remote_autostart=0
xdebug.remote_enable=0
xdebug.profiler_enable=0
xdebug.remote_enable=1
xdebug.idekey=some_key
$result = $conn->query('
(
select id, name, "head" as table_name
from head
) union (
select id, name, "body" as table_name
from body
)
');
while ($row = $result->fetch_assoc()) {
$tableName = $row['table_name'];
unset($row['table_name']);
$arr[$tableName][] = $row;
}
$result->free();
<form method="post">
<div class="user">
<h2>Пользователь: 1</h2>
<label id="name">Имя: <input type="text" id="name" name="user[name]"></input></label>
<!-- прочие inputы -->
</div>
<div class="user1">
<h2>Пользователь: 2</h2>
<label id="name1">Имя: <input type="text" id="name1" name="user1[name]"></input></label>
<!-- прочие inputы -->
</div>
<input class="go" type="submit" value="Передать"></input>
</form>