diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-02-15 00:32:19 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-02-15 00:32:19 +0000 |
commit | 1854075a62c6ca0422040b4e5ebf89088b0d02b2 (patch) | |
tree | 4c725cb4ef2b6eab95c0db23cfedcfb3c1406be4 /h-source/Application/Include/myFunctions.php | |
parent | 99e87e1869e49c67bea2b779283def0e98f39bca (diff) |
added wiki - part 1
Diffstat (limited to 'h-source/Application/Include/myFunctions.php')
-rw-r--r-- | h-source/Application/Include/myFunctions.php | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index daefb59..0f87893 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -29,12 +29,39 @@ function encodeUrl($url) $url = str_replace(')','-',$url); $url = str_replace('/','-',$url); $url = str_replace('@','-at-',$url); - $url = urlencode($url); -// $url = html_entity_decode($url, ENT_QUOTES); -// $url = xml_encode($url); - return $url; + + $temp = null; + for ($i=0;$i<strlen($url); $i++) + { + if (strcmp($url[$i],' ') === 0) + { + $temp .= '-'; + } + else + { + if (preg_match('/^[a-zA-Z0-9\-]$/',$url[$i])) $temp .= $url[$i]; + } + } + + $temp = urlencode($temp); + return $temp; } +// function encodeUrl($url) +// { +// $url = str_replace(' ','-',$url); +// $url = str_replace('[','-',$url); +// $url = str_replace(']','-',$url); +// $url = str_replace('(','-',$url); +// $url = str_replace(')','-',$url); +// $url = str_replace('/','-',$url); +// $url = str_replace('@','-at-',$url); +// $url = urlencode($url); +// // $url = html_entity_decode($url, ENT_QUOTES); +// // $url = xml_encode($url); +// return $url; +// } + function smartDate($uglyDate = null, $lang = 'en') { @@ -472,4 +499,17 @@ function getUrlsFromIdHard($id_hard) return array('urlView'=>$urlView,'urlTalk'=>$urlTalk,'modelName'=>$deviceName); +} + +function getDiffArray($associativeArray, $oldArray, $newArray) +{ + $diffArray = array(); + foreach ($associativeArray as $field => $label) + { + if (array_key_exists($field,$oldArray) and array_key_exists($field,$newArray)) + { + $diffArray[$label] = htmlDiff($oldArray[$field], $newArray[$field]); + } + } + return $diffArray; }
\ No newline at end of file |