Бортовой журнал Ктулху

Posts Tagged 'php' [страница 2]

php

PHP - язык - рок'н'ролльщик - рожден жить быстро и умирать молодым.

Gmail API message.send using PHP and curl

This code example shows how to send email using Gmail API method 'message.send' and PHP.

Articles tagged

Read more...

Graphs in PHP in 5 Minutes (BFS)

A graph is a set of connected points — just like people in a social network, cities on a map, or links between web pages.

Sometimes we need to find the shortest connection — for example, the fewest hops between two people. That’s where Breadth-First Search (BFS) helps.

It explores all neighbors first, then moves level by level — guaranteeing the shortest path in an unweighted network.

Articles tagged

Read more...

Hash Maps vs Loops — Fatality in PHP Performance

Many PHP developers use nested loops for data lookups or joins. But in some cases, a simple hash map (associative array) can make your code several times faster.

Let’s compare them with two short benchmarks (10 000 records each).

Articles tagged

Read more...

include или require на примерах

Так чтобы окончательно закрыть все вопросы касательно функция include и require на примерах покажу разницу в поведении этих функций.

Articles tagged

Read more...

ModX: имя чанка недопустимо

При сохранении чанка возникает ошибка "Такое имя чанка недопустимо!"

Articles tagged

Read more...

Override the GridView table view in Yii2

How to change table view in Yii2 component GridView.

First of all, you should override standard files. For this you need to create in /%yii dir%/components your own "GridView", en example "MyGridView".

Articles tagged

Read more...

Owl carousel для Битрикса

Есть очень хороший и любимый мною слайдер Owl Carousel.

И сегодня я напишу как его интегрировать в Битрикс.

 

Articles tagged

Read more...

PHP AJAX CRUD: создание, удаление, редактирование записей в БД MySQL

В этой статье мы узнаем о том, как добавлять, редактировать и удалять записи в базе данных MySQL, используя PHP. Мы использовали обработчик JQuery, который посылает AJAX запрос к серверному скрипту. Обработчик обновляет список записей.

Articles tagged

Read more...

PHP array_filter() and 0 in array

If we have an array in PHP with one of its values equal to 0, after array_filter(), this value is removed. But sometimes we consider 0 a valid value. 

The second argument of this function helps us. We will write a callback function with a custom filter for empty values, excluding zero.

Articles tagged

Read more...

PHP Redis авторизация | ERR invalid password

Недавно добавлял авторизацию в PHP коннекторе Redis и столкнулся с неожиданной проблемой.

Дело в том, что по умолчанию там (в Redis который запущен на сервере) установлен пароль "foobared". Если заходить через клиента Redis (не PHP), то все нормально, заходит, все видит. Но вот из PHP нет подключения, хоть ты тресни.

В принципе, все решается просто - нужно не использовать стандартный пароль.

Articles tagged

Read more...