我想"反转"构成ip地址的四个八位字节(字节)的顺序.
假设我有这个ip:
202.168.56.32
Run Code Online (Sandbox Code Playgroud)
我需要转换成:
32.56.168.202
Run Code Online (Sandbox Code Playgroud)
然后最终删除反向ip中的第一个八位字节.最后结果:
56.168.202
Run Code Online (Sandbox Code Playgroud)
我的尝试:
echo 202.168.56.32 | rev
Run Code Online (Sandbox Code Playgroud)
但它正在回归:
23.65.861.202
Run Code Online (Sandbox Code Playgroud) 我尝试密码保护文件的位置阻止说admin.php不起作用。以下是我的Nginx配置
location = /admin.php {
root /var/www/site.com/public_html/www;
index index.php index.html index.htm;
auth_basic "Restricted Area";
auth_basic_user_file /var/www/site.com/public_html/htpasswd;
}
location ~* \.php$ {
root /var/www/site.com/public_html/www;
try_files $uri =404;
fastcgi_pass unix:/tmp/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 300;
}
Run Code Online (Sandbox Code Playgroud)
我尝试更改location = /admin.php {为 location ~/admin\.php$ {,location /admin.php {但均无效果
admin.php的网址是:https : //mysite.com/admin.php
是的,我每次尝试后都重新加载了Nginx
亲切的问候
我试图将其extension_dir存储在一个变量中
php -i | grep extension_dir 给
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules 作为输出
我想存储 /usr/lib64/php/modules一个变量
这就是我想
php -i | grep extension_dir | cut -d'>' -f3给/usr/lib64/php/modules
我怎样才能在开始时删除空间
我欢迎任何清洁解决方案
Heredoc 不适用于以下代码
$html = <<<HTML
<video width="$width" height="$height" controls preload autoplay >
<source src="$video_url_direct" type="video/mp4" />
<object id="flowplayer" width="$width" height="$height" data="$player_url" type="application/x-shockwave-flash">
<param name="allowfullscreen" value="true" />
<param name="wmode" value="transparent" />
<param name="flashvars" value='config={"clip":"$video_url", "plugins": {"controls": {"autoHide" : false} }}' />
</object></video>
HTML;
Run Code Online (Sandbox Code Playgroud)
我也可以使用heredoc作为flashvars值(即另一个heredoc内的heredoc)。
我有一个json,如下所示.我想访问.的值.adult但是,当 echo json_decode($json_response, true);我得到.Array to string conversion这里有什么问题?
{
"responses": [
{
"safeSearchAnnotation": {
"adult": "VERY_UNLIKELY",
"spoof": "VERY_UNLIKELY",
"medical": "UNLIKELY",
"violence": "LIKELY"
}
}
]
}
Run Code Online (Sandbox Code Playgroud) 假设我有一个叫做变量$subdomain包含test.google.com.怎么可以剥夺我的子域获得google.com并将其存储在一个变量名为$ maindomain.
我想结合这2的preg_replace成一个单一的one.For例如每更换data-thumb-bg="与style="background-image: url('和之后,如果有.jpg将其替换为.jpg);.
$input = preg_replace('#data-thumb-bg="#s', 'style="background-image: url(', $input);
$input = preg_replace('#.jpg#s', '.jpg);', $input); //this must be executed only if a match has been found for above
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点 ?
编辑
我想我错误地表达了自己
该.jpg应更换只有 data-thumb-bg=一直replaced.Like首先你更换data-thumb-bg,那么你更换.jpg后面的data-thumb-bg
亲切的问候
我很难理解>>>java中的bitwise运算符.
int a = 60;
int c = 0;
c = a >>> 2;
System.out.println("a >>> 2 = " + c );
Run Code Online (Sandbox Code Playgroud)
结果是15
但它怎么变成15?
我已经能够成功添加日期选择器,但我希望日历显示在日期输入下方而不是上方
HTML5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Jobportal - Login</title>
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"></script>
<!-- HTML5 shim …Run Code Online (Sandbox Code Playgroud)