note 88094 added to function.chr
| From: | WGRStudio at osu1 dot php dot net | Date: | Fri, 09 Jan 2009 23:13:19 +0000 |
| Subject: | note 88094 added to function.chr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149019@lists.php.net to get a copy of this message | ||
English:
Pyramid keops to create tables of characters (I used to create the categories and subcategories in
several levels ...: p
They took me 4 days to reach the design desired result
WARNING! Heavy algorithm
Français:
la pyramide de keops pour la création des tableaux des caractères (il me servent a créer
des catégories et sous catégories en plusieurs niveaux... :p
Ils m'ont fallu 4 jours de conception pour arriver au résultat désirée
ATTENTION!!! Algorithme lourd
<?php
/**
* @author WGR Studio
* @email webmaster[at]wgrstudio[dot]com
* @website http://www.wgrstudio.com/
* @company WGR Studio
* @copyright 2002 - 2009
* @project WGR CMS
*
**/
ob_start();
echo ("ROOT ");
ini_set("memory_limit", -1);
function getRoot($limita) {
$limita = ($limita < 1?1:($limita > 10?10:$limita));
$arata = range(chr(97), chr((96 + $limita)));
$caractere = range(chr(65), chr(90));
for ($theads = 0; $theads < sizeof($arata); ++$theads):
$thead = $arata[$theads];
$return[$thead] = getIndex($thead, ($limita - 2));
endfor;
return $return;
}
flush();
function getIndex($litera = false, $adancime = 0) {
$caractere = range(chr(97), chr(122));
if ($litera):
if ($adancime > 0):
foreach ($caractere as $a => $b):
$return[$b] = getIndex($b, ($adancime - 1));
endforeach;
return $return;
endif;
$return[$litera] = $caractere;
return $return[$litera];
endif;
return $caractere;
}
echo ("<pre>");
print_r(getRoot(3));
#var_dump(getRoot(3));
echo ("</pre>");
flush();
ob_end_flush();
/**
* The contents of this file is used only in projects designed by WGR Studio.
* Any change lines below can cause errors in the functioning of the software.
*
* @project WGR CMS
* @copyright 2002 - 2009
**/
?>
----
Server IP: 195.221.21.36
Probable Submitter: 82.245.98.245
----
Manual Page -- http://www.php.net/manual/en/function.chr.php
Edit -- https://master.php.net/note/edit/88094
Del: integrated -- https://master.php.net/note/delete/88094/integrated
Del: useless -- https://master.php.net/note/delete/88094/useless
Del: bad code -- https://master.php.net/note/delete/88094/bad+code
Del: spam -- https://master.php.net/note/delete/88094/spam
Del: non-english -- https://master.php.net/note/delete/88094/non-english
Del: in docs -- https://master.php.net/note/delete/88094/in+docs
Del: other reasons-- https://master.php.net/note/delete/88094
Reject -- https://master.php.net/note/reject/88094
Search -- https://master.php.net/manage/user-notes.php