Skip to content

Instantly share code, notes, and snippets.

View TheAhmedGad's full-sized avatar
🎮
Enjoy Working

Ahmed Gad TheAhmedGad

🎮
Enjoy Working
  • Cairo
View GitHub Profile
@TheAhmedGad
TheAhmedGad / balanced-string.php
Created December 27, 2020 02:23
ParentAps Offline Tasks
<?php
function checkIfBalanced($string)
{
$stack = [];
$matches = ["(" => ")", "{" => "}", "[" => "]"];
for ($i = 0; $i < strlen($string); $i++) {
$currentChar = $string[$i];
//balanced not start with a closure before start
if (!count($stack) && in_array($currentChar, array_values($matches)))
return false;
@TheAhmedGad
TheAhmedGad / utf8-arabic-ci.md
Last active November 27, 2023 23:10
Add Arabic utf8 arabic case insensitive Collation to MYSQL ENGINE

Support Arabic CI Collation

To make mysql understand Arabic letters synonyms like "أ" and "إ"

  • Run This to get Collation Path SHOW VARIABLES LIKE 'character_sets_dir';

  • in /collation/path/Index.xml add this to <charset name="utf8"> section