mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
File locations:
nginx.conf
to/usr/local/etc/nginx/
default
anddefault-ssl
to/usr/local/etc/nginx/sites-available
homebrew.mxcl.nginx.plist
to/Library/LaunchDaemons/
<?php | |
// echo phpinfo(); | |
// Set the content-type | |
// header('Content-Type: image/png'); | |
header ("Content-type: image/png"); | |
$x = 600; | |
$y = 1240; | |
// $x = 240; |
[\((][\s\S]*[\))] |
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
File locations:
nginx.conf
to /usr/local/etc/nginx/
default
and default-ssl
to /usr/local/etc/nginx/sites-available
homebrew.mxcl.nginx.plist
to /Library/LaunchDaemons/
<div id="views">views!!!begin!!! | |
<?php | |
print views_embed_view('foodbanks', 'block', $state); | |
?> | |
<a href="##" id= "freash" >freash!!!</a> | |
<script type="text/javascript"> | |
(function($) { | |
function getInfo(args) { | |
$.ajax({ |
<?php | |
// Create wrapper around the node. | |
$wrapper = entity_metadata_wrapper('node', $node); | |
// We can do it also using only $nid. | |
$wrapper = entity_metadata_wrapper('node', $nid); | |
// Get the value of field_name of the nodes author's profile. | |
$wrapper->author->profile->field_name->value(); | |
$wrapper->author->profile->field_name->set('New name'); |
module_load_include('inc', 'block', 'block.admin'); | |
global $theme_key; | |
$blocks = block_admin_display_prepare_blocks($theme_key); | |
foreach ($blocks as $key => $block) { | |
if($block['info']=='Social Views txt3') $block_delta1=$block['delta']; | |
if($block['info']=='Social Views txt4') $block_delta2=$block['delta']; | |
} | |
$block_text1 = module_invoke('block', 'block_view', $block_delta1); | |
$block_text2 = module_invoke('block', 'block_view', $block_delta2); |
/** | |
* Geolocation | |
*/ | |
$ip = $_SERVER['REMOTE_ADDR']; | |
$result = db_select('ip_geolocation', 'g') | |
->fields('g') | |
->condition('ip', $ip, '=') | |
->execute() | |
->fetchAssoc(); |
//正则表达式获取URL参数 preg get URL parameter | |
//http://stackoverflow.com/questions/11706986/php-getting-url-variable-with-preg-match | |
$subject = "http://www.mysite.com?id=05&name=johnny"; | |
$pattern = '/id=[0-9A-Za-z]*/'; //$pattern = '/id=[0-9]*/'; if it is only numeric. | |
preg_match($pattern, $subject, $matches); | |
print_r($matches); |
<!DOCTYPE html> | |
<html lang="zh-cn"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Multiple cURL Requests with PHP</title> | |
<!-- Bootstrap --> | |
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.min.css"> |