Skip to content

Instantly share code, notes, and snippets.

View janpecha's full-sized avatar

Jan Pecha janpecha

View GitHub Profile
janpecha / verifyIC.php
Created February 16, 2023 06:16 — forked from dg/verifyIC.php
Ověření rodného čísla a IČ
View verifyIC.php
function verifyIC($ic)
// be liberal in what you receive
$ic = preg_replace('#\s+#', '', $ic);
// má požadovaný tvar?
if (!preg_match('#^\d{8}$#', $ic)) {
return FALSE;
View gist:bc9566e95f21ad7b2ef0
// $foo = Mage::getModel('.....
// $bar = Mage::getModel('.....
$transaction = Mage::getModel('core/resource_transaction');
$transaction->save(); // runs save on all objects. On error -> rollback