Nothing different, the following content is for a Java programmer to master the skills of comparison with PHP! Tell you, they are actually the same, but tools, no high and low points.
But you are not proficient, do not know!
1, syntax: Must be
A simple template engine was used in a project of the time, but it was also a template engine for reference to Discuz, and it was simple to compile some custom tags into PHP code. Already said is very simple, so the compile time is also famous for
How to use: (Run at the command line)
Copy CodeThe code is as follows:
PHP compactor.php destination.php source.php
Download: compactor.php
Copy CodeThe code is as follows:
#!/usr/bin/env PHP
/**
* Compact PHP code.
*
* Strip comments, combine
1. Create a file (test.php)
My path is as follows
F:\Projects\PHPTest\test.php
2. Open the Apache configuration file with Notepad
D:\Program files\zend\apache2\conf\httpd.conf
On the last line join
Alias/test
This is the implementation of the Select default selection for the extended yibing
Copy CodeThe code is as follows:
Value= "1" > Residences
Value= "2" > Office
Value= "3" > Business Room
Value= "4" > Plant
Value= "5" >
the difference between 1.echo and print
The functions of Echo and print in PHP are basically the same (output), but there are subtle differences between the two. There is no return value after the echo output, but print has a return value and
Smarty can encode URLs directly, such as
But in the smarttemplate as if there is no, because the link is submitted by JS, not the form submission, so it cannot be automatically encoded.
Workaround: Use JS to the URL of the Chinese character escape
PHP Read radio button Radio value
Copy CodeThe code is as follows:
PHP read radio button Radio value
if ($_post)
{
Echo ' You have chosen single choice ', $_post[' RadioGroup1 '];
Because the properties of a radio button can
But today in the installation of the test program is prompted Zend Optimizer not installed. This makes me very confused, so common space why did not install Zend, and then I look at info.php, I was surprised to find that the server Zend unexpectedly
1. Sys_getloadavg ()
SYS_GETLOADAVT () can obtain the system load condition. The function returns an array of three elements, each representing the average load for the system in the past 1, 5, and 15 minutes.
Instead of letting the server down
Write a simple fetch page function first
Copy CodeThe code is as follows:
function Getsources ($URL, $User _agent= ", $Referer _url=")//Fetch a specified page
{
$URL the page address to crawl
$User _agent need to return user_agent information such
The output control function does not affect the header information sent using header () or Setcookie (), only data blocks that resemble Echo () and PHP code are useful.
Let's start with a simple example that gives you a general impression of the
Copy CodeThe code is as follows:
/* Creates a compressed zip file */
function Create_zip ($files = Array (), $destination = ", $overwrite = False) {
If the zip file already exists and overwrite is false, return false
if (file_exists ($destination) &&
Constructing a SQL statement is a comparison.
Copy CodeThe code is as follows:
$sql = ' SELECT *
From Sdb_comments
WHERE goods_id = '. Intval ($goods _id). '
and for_comment_id is NULL
and object_type = ". $item."
and disabled= "false"
and display =
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service