Initial commit

This commit is contained in:
JoseluCross
2017-09-17 18:22:54 +02:00
commit 5531725cfe
135 changed files with 19288 additions and 0 deletions

39
Source/src/functions.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
/**
* Created by PhpStorm.
* User: joselucross
* Date: 6/07/17
* Time: 11:56
*/
function RandomString($length)
{
//https://phpes.wordpress.com/2007/06/12/generador-de-una-cadena-aleatoria/
$source = 'abcdefghijklmnopqrstuvwxyz';
$source .= '1234567890';
if($length>0){
$rstr = "";
$source = str_split($source,1);
for($i=1; $i<=$length; $i++){
mt_srand((double)microtime() * 1000000);
$num = mt_rand(1,count($source));
$rstr .= $source[$num-1];
}
}
return $rstr;
}
function ksonParse($path){
$file = fopen($path,"r");
$array = [];
if($file){
while(!feof($file)){
$line = fgets($file);
$part = explode(":",$line);
$array[$part[0]]=$part[1];
}
return $array;
}else{
die('<h3>Error, kson file not exist</h3>');
}
}