PHP
- 2 ответа
- 0 вопросов
2
Вклад в тег
$array=Array
(
0 => 'Куртка Waterproof-01.jpg',
1 => 'Куртка Waterproof-02.jpg',
2 => 'Куртка Waterproof-03.jpg',
3 => 'Куртка Water Mod-01.jpg',
4 => 'Куртка Water Mod-02.jpg'
);
$new = [];
foreach ($array as $el) {
@$new[preg_replace('/[\-0-9]/i', '', $el)][] = $el;
}
echo '<pre>';
print_r($new);
echo '</pre>';
<?php
$name = htmlspecialchars(@$_REQUEST["name"], ENT_QUOTES);
$second = htmlspecialchars(@$_REQUEST["second"], ENT_QUOTES);
$email = htmlspecialchars(@$_REQUEST["email"], ENT_QUOTES);
$message = htmlspecialchars(@$_REQUEST["message"], ENT_QUOTES);
$to = "myMail@gmail.com";
$subject = "A new message from website!";
$body = "Имя:" . $name ."\n" . "Отчество:" . $second ."\n" . "Имейл: " .$email ."\n" . "Сообщение:" . $message;
$header = "From :" .$email;
mail($to, $subject, $body, $header);
?>