Tags » Php

Install Linux, Nginx, MySQL, PHP Using LEMP stack

Step 1 : To install Git

First, as always, we should start out by running general OS and package updates. On Ubuntu we’ll do this by running: 39 more words


PHP serve local folder

cd path/to/your/folder
php -S localhost:8080

Pada codeigniter query builder gimana menggunakan $db->where untuk memandingkan antar column ?

Saya gunakan coding seperti ini :


Malah membandingkan string, bukan column nya :

WHERE `s`.`qty` <= 'p.min_stock'

Tpi alhamdulillah dapat solusi dari StackOverflow , langsung dijadikan string pada clause where nya : … 23 more words

Convert PHP script to JavaScript

  • Add the “base-reality/php-to-javascript”: “>=0.0.3” to your project’s composer.json file:

    “require”:{ “base-reality/php-to-javascript”: “0.1.16” }

    Or the latest tagged version. The dev master should only be used for development, not production.\ …

  • 39 more words

Triangular Phun

Photo on Flickr by Larkspur Studio

Some academic questions are simply too fun, i.e. phun in old-style PHP lingo, to shun. For example, how might one display prime numbers in the shape of a right-angled triangle with PHP? 725 more words


Get List of brand attribute options and swatch images + magento 2

$attributeCode = ‘brand’;
$entityType = ‘catalog_product’;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$attributeInfo = $objectManager->get(\Magento\Eav\Model\Entity\Attribute::class)
->loadByCode($entityType, $attributeCode);
$attributeId = $attributeInfo->getAttributeId();
$attributeOptionAll = $objectManager->get(\Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\Collection::class)
$optionsAll = $attributeOptionAll->getData(); 78 more words