aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Include/myFunctions.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Include/myFunctions.php')
-rw-r--r--h-source/Application/Include/myFunctions.php48
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