- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
<?php
function php2js ($var) {
if (is_array($var)) {
$res = "[";
$array = array();
foreach ($var as $a_var) {
$array[] = php2js($a_var);
}
//return "[" . join(",", $array) . "]";
return "" . join(",", $array) . "";
}
elseif (is_bool($var)) {
return $var ? "true" : "false";
}
elseif (is_int($var) || is_integer($var) || is_double($var) || is_float($var)) {
return $var;
}
elseif (is_string($var)) {
//return "\"" . addslashes(stripslashes($var)) . "\"";
return "" . addslashes(stripslashes($var)) . "";
}
return FALSE;
}
Increment_Excrement 20.05.2019 00:48 # 0
sslion 20.05.2019 07:53 # 0