string str_pad ( string $input , int $pad_length [, string $pad_string = " " [, int $pad_type = STR_PAD_RIGHT ]] )
This function returns the input string padded on the left, the right, or both sides to the specified padding length. If the optional argument pad_string is not supplied, the input is padded with spaces, otherwise it is padded with characters from pad_string up to the limit.
Как исправить?После обработки данных формы бэкенд должен средиректить пользователя куда-нибудь. Адрес может быть тем же самым, главное, чтобы браузер сделал get-запрос, тогда обновление страницы будет работать как ожидается.
include "/conn.php";
include "/showarticles.php";
./conn.php
.docker-php-ext-install ... mysqli pdo_mysql ...
.docker-php-ext-install ... mysql pdo_mysqli ...
.<?php
trait ParentAware {
public function getParent(){
return array_merge(self::$arr, parent::getParent());
}
}
class base {
public function getParent(){
return ['base'];
}
}
class class1 extends base {
use ParentAware;
public static $arr = ['class1'];
}
class class2 extends class1 {
use ParentAware;
public static $arr = ['class2'];
}
class class3 extends class2 {
use ParentAware;
public static $arr = ['class3'];
}
var_dump((new class3)->getParent());
//array(4) {
// [0] => string(6) "class3"
// [1] => string(6) "class2"
// [2] => string(6) "class1"
// [3] => string(4) "base"
//}
<?php
class base
{
public static $arr = ['base'];
public function getParent()
{
$parentClasses = class_parents($this);
$result = static::$arr;
foreach ($parentClasses as $parentClass) {
$result = array_merge($result, $parentClass::$arr);
}
return $result;
}
}
class class1 extends base
{
public static $arr = ['class1'];
}
class class2 extends class1
{
public static $arr = ['class2'];
}
class class3 extends class2
{
public static $arr = ['class3'];
}
$new = new class3();
var_dump($new->getParent());
//array(4) {
// [0] => string(6) "class3"
// [1] => string(6) "class2"
// [2] => string(6) "class1"
// [3] => string(4) "base"
//}
foreach($result->items as $item) {
echo 'ID: '.$item->id->videoId.'<br><br>
TITLE: '.$item->snippet->title.'<br><br>
DESC: '.$item->snippet->description.'<br><br>
<img width=120 height=90 src='.$item->snippet->thumbnails->default->url.'><br><br>
<img width=320 height=180 src='.$item->snippet->thumbnails->medium->url.'><br><br>
<img width=480 height=360 src='.$item->snippet->thumbnails->high->url.'><br><br>
<iframe width=600 height=500 src=https://www.youtube.com/embed/'.$item->id->videoId.'?feature=oembed frameborder=0 allowfullscreen></iframe><br><br>';
}
.guest {
body {
background-color: green;
}
}
.user {
body {
background-color: yellow;
}
}
<html class="<?= $isGuest ? 'guest' : 'user'; ?>">
...
</html>
Не могу понять, почему он пытается загрузить Class 'Router' , вместо того, чтобы выполнить условие.Потому что вы ему об этом говорите при помощи
new Router($uri)
. <span class="quantity">
<strong>
<?php echo $cart_count_products; ?>
<?php echo \Custom\Helper\CommonHelper::pluralize(
$cart_count_products,
$this->language->get('переменная1'),
$this->language->get('переменная2'),
$this->language->get('переменная3')
); ?>
</strong>
</span>
срочно нужно нормально решениеИзмените структуру БД. Другого решения тут просто быть не может.