\r\n
, также известные как CRLF или 0A 0D
или 10 13
.$str = "@1@ @2@";
preg_match_all("/@(\d+)@/", $str, $matches);
var_dump($matches[1]); // Массив ID
$str = "@1@ @2@";
echo preg_replace_callback("/@(\d+)@/", function($arr) {
return "<a href='cards/" . $arr[1] . "'>@" . $arr[1] . "@</a>"; // В $arr[1] ID
}, $str);
SELECT COUNT(id) AS COUNT, GROUP_CONCAT(id) as ids, is_positive
FROM test
GROUP BY is_positive
SELECT * FROM :table WHERE
company_id = :company_id
OR parent_id = (
SELECT id FROM :table WHERE company_id = :company_id)
OR parent_id IN (
SELECT id FROM :table WHERE parent_id = (
SELECT id FROM :table WHERE company_id = :company_id))
опции через запятую
SELECT DISTINCT `title` FROM `hotel`
LEFT JOIN `hotel_option` ON `id` = `hotel_id`
WHERE `option_id` IN(...)