root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.js,*.jsx]
indent_size = 2
echo implode(' ', array_map(function($d) {
return '<span>'.trim($d).'</span>';
}, explode(',', trim($q, ','))));
Settings - Editor - Code Style - HTML - Other > Aligin attributes
Settings - Editor - Code Style > Hard wrap at: <число символов>
либо запретить переносить конкретно html атрибуты: Settings - Editor - Code Style - HTML - Other > Wrap attributes: Do not wrap
Since every developer uses a different IDE, the recommended way to enable this feature is to configure it on a system level. This can be done by setting the xdebug.file_link_format option in your php.ini configuration file.
# services.yaml
imports:
- { resource: 'local.yaml', ignore_errors: true }
# local.yaml
framework:
ide: 'phpstorm://open?file=%%f&line=%%l'
# .gitignore
/config/local.yaml
<?php if(условие_есть_ли_видео): ?>
<a class="videofront" href="<?php the_permalink(); ?>"><video src="<?php the_field('video'); ?>" loop="on" autoplay="on" height="110" width="200"/></a>
<?php else: ?>
<a class="iconb-game" href="<?php the_permalink(); ?>" title="<?php _e('Play', 'arcadexls'); ?>"><span><?php _e('Play', 'arcadexls'); ?></span></a>
<?php endif; ?>
$arr = [
'863|20',
'863|50',
'822|100',
'822|100'
];
$out = [];
foreach ($arr as $item) {
[$k, $v] = explode('|', $item);
$out[$k][] = $v;
}
var_dump($out);
array (size=2)
863 =>
array (size=2)
0 => string '20' (length=2)
1 => string '50' (length=2)
822 =>
array (size=2)
0 => string '100' (length=3)
1 => string '100' (length=3)
$arr = [
'863|20',
'863|50',
'822|100',
'822|100'
];
$out = [];
foreach ($arr as $item) {
[$k, $v] = explode('|', $item);
$out[$k] = ($out[$k] ?? 0) + $v;
}
var_dump($out);
/*
array (size=2)
863 => int 70
822 => int 200
*/
$headers = array_column($data[0]['pages'], 'name');
$columns = array_column($data[0]['pages'], 'attribute');
$rowCount = max(array_map('count', $columns));
$headersHTML = implode('', array_map(function($n) {
return "<th>$n</th>";
}, $headers));
$rowsHTML = implode('', array_map(function($i) use($columns) {
return "
<tr>".implode('', array_map(function($n) use($i) {
return "<td>".($n[$i] ?? '')."</td>";
}, $columns))."
</tr>";
}, range(0, $rowCount - 1)));
echo "
<table>
<thead>
<tr>$headersHTML</tr>
</thead>
<tbody>$rowsHTML</tbody>
</table>";