$.fn.serializeObject = function()
{
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
o[this.name] = this.value || '';
}
});
return o;
};
var fieldValue = $('input[name="name"]').val();
location ^~ /uploads/thumbs/ {
root /home/admin/web/site-b.com/public_html;
try_files $uri @proxy;
}
location @proxy {
proxy_pass http://11.22.33.44:80$uri;
proxy_set_header Host site-a.com;
}
<a href="#" class="img__link"> <img src="path" /></a>
a { display: block; position: relative; }
a:after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); opacity: 0; }
a:before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: url(icon-path); opacity: 0; }
a:hover:before,
a:hover:after { opacity: 1; }
<a href="#" class="img__link">
<img src="path" />
<span class="img__mask"><i class="img__icon"></i></span>
</a>
a { display: block; position: relative; }
.mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); opacity: 0; }
a:hover:after {
opacity: 1;
}
$header = "<tr>".implode("", array_map(function($n) {
return "<th>$n</th>";
}, array_keys($array)))."</tr>";
$rowsCount = max(array_map(function($n) {
return count($n);
}, $array));
$rows = implode("", array_map(function($i) use($array) {
foreach ($array as $item) {
$row[]= "<td>".(isset($item[$i]) ? $item[$i] : "")."</td>";
}
return "<tr>".implode("", $row)."</tr>";
}, range(0, $rowsCount - 1)));
echo "<table>$header$rows</table>";
$max = 0;
foreach ($array as $title => $item) {
$max = max($max, count($item));
}
$rows = [];
for($i = 0; $i < $max; $i++) {
foreach ($array as $item) {
$rows[$i][] = $item[$i] ?? '';
}
};
$titles = array_keys($array);