Skip to content

Instantly share code, notes, and snippets.

View med-ezzairi's full-sized avatar

M.EZZAIRI med-ezzairi

  • V12Software
  • Santa Clara
View GitHub Profile
@med-ezzairi
med-ezzairi / number_to_string.php
Created November 26, 2020 21:49 — forked from ismaail/number_to_string.php
Convert Number to Text (FR)
<?php
function number_to_string($number): string
{
$whole = floor($number);
$decimal = bcsub($number, $whole, 2);
$decimalPrefix = (-1 === bccomp($decimal, 0.1, 2)) ? 'zéro ' : '';
$decimal = bcmul($decimal, 100, 2);
@med-ezzairi
med-ezzairi / HO_number_helper
Created November 26, 2020 21:38 — forked from broject/HO_number_helper
money to text
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
if (!function_exists('number_str')) {
function number_str($number) {
$strp = strpos($number, '.');
$n = $strp > 0 ? substr($number, 0, $strp) : $number;
/* Arabic initialisation for the jQuery UI date picker plugin.
* Written by M. EZZAIRI (med.ezzairi{at}gmail.com)
*
*/
jQuery(function($){
$.datepicker.regional['ar'] = {
closeText: 'أغلق',
prevText: 'السابق',
nextText: 'التالي',
currentText: 'اليوم',
@med-ezzairi
med-ezzairi / RIB.php
Created March 5, 2020 13:57
A RIB validation rule, could be used with Laravel ^5.5 or separately
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
/**
* RIB validation (valide in morocco only)
*
* @author med-ezzairi
*