if (expression):
?>
Statement
endif
?>
Copy CodeThe above notation is the alternative syntax for PHP's Process control.There are several alternative syntaxes in the PHP Process
gettype-getting variable typesGrammar:String GetType (mixed $var)The possible values for the returned string are:BooleanIntegerDoubleStringArrayObjectResourceNullUnknown typeAttention:Do not use GetType () to test for a type, because its returned
With ImageMagick, you can easily and quickly create thumbnails that are much easier to use than PHP.
Location to upload main image:
$mainDir = $_server[' Document_root '). ' /images/l/';
Location to create the thumb
php Getting Started (basic, variable, constant, structure statement), a friend of the need can refer to. Basic knowledge: ?> can omit string connectors are. Comments//Variables variables must have a first letter of $, a letter or underscore "_"
A powerful and easy-to-use PHP microarchitecture designed to help you build dynamic and powerful Web applications-fast!The entire frame size is less than 60kb, although lightweight, but not simple. The support for routing, ORM, and MVC is very good.
Using the PHP code provided on the server to download, you can specify the name of the downloaded file, you can dynamically specify the contents of the file
Local file that should is send to the client
$local _file = ' test.zip ';
function Getweekstartandend ($year, $week =1) {
Header ("Content-type:text/html;charset=utf-8");
Date_default_timezone_set ("Asia/shanghai");
$year = (int) $year;
$week = (int) $week;
Calculates the total year of the week by
PHP uses HTTP_BUILD_QUERY,PARSE_URL,PARSE_STR to create and parse URLs, and the friends you need can refer to them.1.http_build_queryHttp_build_query can create a request string after UrlEncode.
String Http_build_query (mixed
BOOL Setcookie (String $name [, String $value [, int $expire = 0 [, String $path [, String $domain [, bool $secure = Fals e [, bool $httponly = FALSE]]]]
Explain:this requires that's calls to this function prior to any output, including and
Get the last day of a month or the number of days of a month
function Getmonthlastday ($month, $year)
{
Switch ($month)
{
Case 4:
Case 6:
Case 9:
Case 11:
$days = 30;
Break
Case 2:
/**
* Picture shrinkage Water printing type
*
*/
Class Cls_photo
{
protected $waterrate = 0.2; The scale of the watermark icon on the picture
protected $width = 300; Thumbnail default width
protected $height =
Sometimes in order to adjust the interface periodically, the program needs to run automatically. There are two ways to do this from the Internet: 1, Ignore_user_abort () Ignore_user_abort () functions with Set_time_limit (0) and sleep ($interval)
Local file that should is send to the client
$local _file = ' test-file.zip ';
filename that the user gets as default
$download _file = ' your-download-name.zip ';
Set the download rate limit (= 20,5 kb/s)
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