server {
index index.html index.htm index.php;
server_name test.loc;
location / {
try_files $uri $uri/ /index.php?$args;
}
#error_page 500 502 503 504 /50x.html;
location ~ \.php$ {
if ($cookie_VAR = "1") {
root /Users/evgenij/projects/www/1;
}
if ($cookie_VAR = "2") {
root /Users/evgenij/projects/www/2;
}
root /Users/evgenij/projects/www/3;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
}
curl --cookie "VAR=1" http://test.loc
curl --cookie "VAR=2" http://test.loc
curl http://test.loc
$new_var= preg_replace('/href="\/uploads/', '123', $var);
$.ajax({
type: "get",
url: 'http://rate-exchange.appspot.com/currency?from=RUB&to=KZT&q=1',
dataType: "jsonp",
success: function(data){
console.log(data);
},
error : function(data){
console.log(data);
}
});
$time = '123h 5 m 07s';
if (preg_match('~(\d+)\s*h~', $time, $match)
$hours = $match[1];
if (preg_match('~(\d+)\s*m~', $time, $match)
$minutes = $match[1];
if (preg_match('~(\d+)\s*s~', $time, $match)
$seconds = $match[1];