<?php
$context = stream_context_create(array(
'http' => array(
'timeout' => 60, // Время ожидания ответа от сервера
)
));
$url = 'https://kristallnails.ru/integration?int=ym&name=businesshunter';
try {
$priceFile = file_get_contents( html_entity_decode($url), false, $context );
} catch (Exception $e) {
info($e->getMessage());
}
print_r($priceFile);
$res = CIBlockElement::GetList(array("rand" => "asc"), $arFilter, false, array("nPageSize" => 50), $arSelect);
<?php
class Path {
const ROOT = __DIR__ . '/';
const WWW = self::ROOT . 'public/';
const KERNEL = self::ROOT . 'kernel/';
const LIBRARY = self::ROOT . 'library/';
const TMP = self::ROOT . 'tmp/';
const LOGS = self::ROOT . 'logs/';
}
// Применение
echo Path::ROOT;
'@picture' => '/uploaded/',
'@upload' => '@app/web/uploaded/',
$file = UploadedFile::getInstance($this, $code);
$filePath = time() . '_' . $file->baseName . '.' . $file->extension;
$file->saveAs('@upload/' . $filePath);
$array = [1,2,3,4,5,6,7,8,9,10];
$chunks = array_chunk($array,3);
for($i=0;$i<=4;$i++){
echo $chunks[0][$i], $chunks[1][$i], $chunks[2][$i], $chunks[3][$i], PHP_EOL;
}
function strip_tags_content($text, $tags = '', $invert = FALSE)
{
preg_match_all('/<(.+?)[\s]*\/?[\s]*>/si', trim($tags), $tags);
$tags = array_unique($tags[1]);
if(is_array($tags) AND count($tags) > 0) {
if($invert == FALSE) {
return preg_replace('@<(?!(?:'. implode('|', $tags) .')\b)(\w+)\b.*?>.*?</\1>@si', '', $text);
}
else {
return preg_replace('@<('. implode('|', $tags) .')\b.*?>.*?</\1>@si', '', $text);
}
}
elseif($invert == FALSE) {
return preg_replace('@<(\w+)\b.*?>.*?</\1>@si', '', $text);
}
return $text;
}