site.ru/ethereum-eth/
, вполне нормальный УРЛ. ethereum-eth-efirium
или ethereum-eth-efir
.ethereum
. if(function1 & function2){
// если обе возвращают true что то делаем.
}
$_POST['title'] = 'title-desc-2013-04-28';
$array = explode('-', $_POST['title']);
$title = $array[0];
$desc = $array[1];
var_dump($title); // title
var_dump($desc); // desc
[$title, $desc] = $array;
$title = 'Носки мужские за 490 руб';
$title = preg_replace('/ за ([0-9]+) руб/i', '', $title);
echo $title;
$arr = [ '...', '...', ... ];
$newStr = preg_replace('~'.implode('|', $arr).'~ui', '', $str);
<select name="coin" class="form-control input-lg">
<?php
foreach($coins as $item) {
$times = date('Y-m-d', $item['date']); // Y-m-d
echo '<option value="' . $times . '">' . $item['name'] . '</option>';
//echo $item['coin'];
}
?>
</select>
$json = '{"status":{"timestamp":"2021-05-03T16:47:16.362Z","error_code":0,"error_message":null,"elapsed":370,"credit_count":0,"notice":null},"data":{"2016-10-26T02:39:28.000Z":{"BTC":[1],"USD":[660.28167725,87283944,10525640015.288086]},"2016-10-27T02:39:28.000Z":{"BTC":[1],"USD":[702.39459229,89816296,11200777509.550781]}}}';
$data = json_decode($json, true);
foreach($data['data'] as $date=>$values) {
$date = date("Y-m-d H:i:s", strtotime($date));
$usd = $values['USD'][0] ?? null;
$usd_two = $values['USD'][1] ?? null;
$usd_three = $values['USD'][2] ?? null;
// Далее здесь можно вызвать функцию, которая сохранит значения в базу
}
/opt/php/7.2/cli/bin/php composer.phar
$template
- это название файла с шаблоном в папке с шаблонами.$args
- Массив для замены значений в письме.public function send_email( $template, $args ) {
ob_start();
include APA_PATH . "/templates/emails/{$template}.php";
$content = ob_get_clean();
foreach ( $args as $key => $value ) {
if ( ! is_array( $value ) && ! is_object( $value ) ) {
$search = '{$' . $key . '}';
$content = str_replace( $search, $value, $content );
}
}
$message = $content;
wp_mail( $this->getEmailTo(), $this->getEmailSubject(), $message, $header );
}
$content
ob_start();
include APA_PATH . "/templates/emails/{$template}.php";
$content = ob_get_clean();
{$user_name}
заменяем на реальные значения с массива и заменяем в переменной $content
foreach ( $args as $key => $value ) {
if ( ! is_array( $value ) && ! is_object( $value ) ) {
$search = '{$' . $key . '}';
$content = str_replace( $search, $value, $content );
}
}
$message = $content;
wp_mail( $this->getEmailTo(), $this->getEmailSubject(), $message, $header );
wp_mail()
- это функция из вордпресс