Skip to content

Instantly share code, notes, and snippets.

View danreb's full-sized avatar

Adolfo G. Nasol danreb

View GitHub Profile
@danreb
danreb / gist:e8b0f8c7cd1d05c04a52e50ce0bc2cd2
Created August 22, 2017 03:55 — forked from tribulant/gist:bf53eaebe29028d902b1
cPanel - Find Malicious Mail Script
grep cwd /var/log/exim_mainlog | grep -v /var/spool | awk -F"cwd=" '{print $2}' | awk '{print $1}' | sort | uniq -c | sort -n
When dealing with arrays in PHP, checking for an index like `if ($a['foo'])` throws a PHP warning.
There are two ways to avoid these warnings: one is using isset(), which checks the existance of an array index. The second one is empty(), which not only checks for the existence of the array index, but also that the value that contains is not empty (not NULL, 0, '' or FALSE).
Here are some console examples:
```bash
juampy@juampybox $ php -a
php > $a = array('foo' => 'asdfasd');
php >
<?php
/**
* @file
* Default theme implementation to display the basic html structure of a single
* Drupal page.
*
* Variables:
* - $css: An array of CSS files for the current page.
* - $language: (object) The language the site is being displayed in.