Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Ricardo Seromenho seromenho

🏠
Working from home
Block or report user

Report or block seromenho

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@seromenho
seromenho / recursive_array_walk_recursive.php
Last active Feb 26, 2016
array_walk_recursive working for objects.
View recursive_array_walk_recursive.php
<?php
class A
{
private $ab = 5;
public $ac = 6;
}
/**
* WARNING: This https://bugs.php.net/bug.php?id=45937 seems not yet solved
@seromenho
seromenho / LuhnValidator.php
Last active Aug 29, 2015
PHP Luhn Validator (from Symfony)
View LuhnValidator.php
<?php
/**
* Validates a value using the LUHN Algorithm.
* @param string $value Value to validate. EG: Credit card number
* @return bool
*/
function isLuhn($value)
{
if (!is_string($value) || !ctype_digit($value)) {
You can’t perform that action at this time.