Совмещают ли php (apache) и node.js на одной машине? Можно ли так делать? Или это глупо?
В гугле есть один,
$search_text = 'лист';
array_filter($array, function($el) use ($search_text) {
return ( strpos($el['text'], $search_text) !== false );
});
<?php
require_once 'vendor/autoload.php';
$fuse = new \Fuse\Fuse([
[
"title" => "Old Man's War",
"author" => "John Scalzi"
],
[
"title" => "The Lock Artist",
"author" => "Steve Hamilton"
],
[
"title" => "HTML5",
"author" => "Remy Sharp"
],
[
"title" => "Right Ho Jeeves",
"author" => "P.D Woodhouse"
],
], [
"keys" => [ "title", "author" ],
]);
$fuse->search('hamil');
/*
Array
(
[0] => Array
(
[title] => The Lock Artist
[author] => Steve Hamilton
)
[1] => Array
(
[title] => HTML5
[author] => Remy Sharp
)
)
*/
Но как мне отловить данные "start"?
Deep linking
Telegram bots have a deep linking mechanism, that allows for passing additional parameters to the bot on startup. It could be a command that launches the bot — or an auth token to connect the user's Telegram account to their account on some external service.
Each bot has a link that opens a conversation with it in Telegram — https://telegram.me/. You can add the parameters start or startgroup to this link, with values up to 64 characters long. For example:https://telegram.me/triviabot?startgroup=test
Telegram отдает данные через WebHook, но в json ответе нет нужных данных.
<?php
$fullName = 'Иванов Алексей Сергеевич';
$arName = explode(' ',$fullName);
$arFirstLetters = array_map(function ($item){
return mb_substr($item, 0, 1);
}, $arName);
$strFirstLetter = implode('', $arFirstLetters);
echo $strFirstLetter;
<?php
$image = imagecreatefrompng('yourlocation/image.png');
imagejpeg($image, 'yournewlocation/image.jpg', 70);
imagedestroy($image);
когда я с этих классов парсю href то парсит только только самый первый, почему не все?
<?php
include 'simple_html_dom.php';
$site = 'http://optnow.ru/catalog';
$data = file_get_html($site);
$catalogLink = array();
if(!empty($data)) {
foreach($data->find('div.cat-name a') as $catalog) {
$catalogLink['url'] = $catalog->href;
$urls[] = $catalogLink;
}
foreach($urls as $url => $k) {
foreach($k as $n) {
$catalogLink = 'http://optnow.ru/' . $n . '?page=0';
$productData = file_get_html($catalogLink);
// смотрим отсюда
foreach($productData->find('.link-pv-name') as $link) {
$productLink['url'] = $link->href;
$productUrls[] = $productLink;
}
}
}
}