$url = file_get_contents("https://api.vk.com/method/wall.get?domain=extrawebdev&access_token=3195e9e93195e9e93115aff35931c30219331953195e9e9697cc67864e1f0c35fe7c074&count=100");
$response = json_decode($url ,true);
$i=0;
$x=0;
while ($x<100)
{
$text = $response['response'][$i]['text'];
$news[$i] = "<div class='item'>
".date("d-m-Y H:i:s", $response['response'][$i]['date'])."<br><br>
".preg_replace("/((ht|f)tp(s)?:\/\/[\w\.\/-]+)|(\#[\w]+\@[\w]+)/is", "<a href=\"$1$4\">$1$4</a>", $text)."
<img src='".$response['response'][$i]['attachment']['photo']['src_big']."'></div>";
$x++;
$i++;
}
$j=1;
while($j<19){
print_r($news[$j]);
$j++;
}
<a href=\"$1($4-этот)\">$1$4</a>
function my_preg_match($run = null, $params = null, $i = 0)
{
preg_match($run, $params, $result);
if (!empty($result[0])) {
return $result[$i];
}
else {
echo 'Вхождений не найдено';
}
}
my_preg_match('/(\d)(\d)/','12'); // result 12
my_preg_match('/(\d)(\d)/','12', 1); // result 1
my_preg_match('/(\d)(\d)/','12', 2); // result 2
$file = <<<EOT
files/3/0/b/8/e/267114fe63e7c563b193852ed72.jpg
files/3/0/b/8/e/267114fe63e7c563b193852ed72.jpg.w1920h520mc.jpg
files/3/0/b/8/e/267114fe63e7c563b193852ed72.jpg.w225h124mc.jpg
files/3/0/b/8/e/267114fe63e7c563b193852ed72.jpg.w280h160mc.jpg
files/3/0/b/8/e/267114fe63e7c563b193852ed72.jpg.w600h450mc.jpg
files/3/0/b/8/e/267114fe63e7c563b193852ed72.jpg.w730h340mc.jpg
files/3/0/b/8/e/267114fe63e7c563b193852ed72.jpg.w820h410mc.jpg
files/9/6/7/b/f/f7ba4cbf32ff8971b352e3fc2ac.jpg
files/9/6/7/b/f/f7ba4cbf32ff8971b352e3fc2ac.jpg.w730h350mc.jpg
files/e/b/1/e/1/05c09ea7a96cf55071450839570.jpg
files/e/b/1/e/1/05c09ea7a96cf55071450839570.jpg.w730h350mc.jpg
files/e/d/2/f/8/7ca3d9a5390be989ca44c8f5d58.jpg
files/e/d/2/f/8/7ca3d9a5390be989ca44c8f5d58.jpg.w730h350mc.jpg
EOT;
preg_match('/^.*?\.jpg/', $file, $m);
echo $m[0]; //files/3/0/b/8/e/267114fe63e7c563b193852ed72.jpg
<div class="znach1"><?php $a = 2.15; ?></div>
<div class="znach2"><?php $b = 1.95; ?></div>
<div class="result"><?= $a*$b; ?></div>
$dec_json = '[
{"slide_1":"Winterfell.jpg",
"slide_2":"The_Eyrie.jp",
"slide_3":"Riverrun (2).jpg",
"slide_4":"Pyke.jpg"
},
{"slide_1":"Winterfell.jpg",
"slide_2":"The_Eyrie.jp",
"slide_3":"Riverrun (2).jpg",
"slide_4":"Pyke.jpg"
},
{"slide_1":"Winterfell.jpg",
"slide_2":"The_Eyrie.jp",
"slide_3":"Riverrun (2).jpg",
"slide_4":"Pyke.jpg"
},
{"slide_1":"Winterfell.jpg",
"slide_2":"The_Eyrie.jp",
"slide_3":"Riverrun (2).jpg",
"slide_4":"Pyke.jpg"
},
{"slide_1":"Winterfell.jpg",
"slide_2":"The_Eyrie.jp",
"slide_3":"Riverrun (2).jpg",
"slide_4":"Pyke.jpg"
},
{"slide_1":"Winterfell.jpg",
"slide_2":"The_Eyrie.jp",
"slide_3":"Riverrun (2).jpg",
"slide_4":"Pyke.jpg"
},
{"slide_1":"Winterfell.jpg",
"slide_2":"The_Eyrie.jp",
"slide_3":"Riverrun (2).jpg",
"slide_4":"Pyke.jpg"
},
{"slide_1":"Winterfell.jpg",
"slide_2":"The_Eyrie.jp",
"slide_3":"Riverrun (2).jpg",
"slide_4":"Pyke.jpg"
}
]';
$q = json_decode($dec_json, TRUE);
var_dump($q);
if ($name == "" || $username == "" || $password = "") {
$message = "<div class='alert alert-danger'><strong>Error! </strong>Field must not be empty</div>";
return $message;
}
preg_match_all("/[^\"][a-z\s]+800x600[a-z\s]+[^\"]\b/U", $str, $m, PREG_SET_ORDER);
echo $m[0][0]."<br>";
echo $m[1][0];