This article illustrates how PHP modifies the size of an uploaded image. Share to everyone for your reference. The implementation method is as follows:
I hope this article will help you with your PHP programming.
Introduce a function that you wrote first.
Copy Code code as follows:
$IMGSRC = "Yun_qi_img/dontlinkme.png";
$width = 780;
$height = 420;
Resizejpg ($IMGSRC, $IMGDST, $width, $height);
function Resizejpg ($IMGSRC, $IMGDST,
The default maximum execution time in php.ini is 30 seconds, which is specified by the Max_execution_time variable in php.ini, if you have a job that takes a lot of time to complete, such as sending lots of emails to a large number of senders, or
The result encountered a problem, Setcookie set the cookie did not take effect, in the browser side also did not see. Check it out, it turns out that Setcookie is done through the header of the HTTP request response, and needs to be executed before
Copy Code code as follows:
Gets the directory name of the specified folder
function Get_dir_name ($dir _path, $file)
{
$dirpath = $dir _path;
$dir = Scandir ($dirpath);
foreach ($dir as $key => $value)
{
if (Is_dir ($dirpath. ') /'.
Do you use Is_file or file_exists to determine whether a file exists?
In writing procedures found in the determination of the existence of documents, there are two ways to write, some people used is_file, some people use file_exists, which better
This example describes a method that has the most frequent 10 digits in an array of PHP statistical values. Share to everyone for your reference. The specific analysis is as follows:
This problem belongs to the category of TOPK, statistics words
Copy Code code as follows:
/*
Author:ssh_kobe
date:20110602
Shortage: If the picture path in the Web page is not an absolute path, you cannot crawl
*/
Set_time_limit (0);//crawl is not limited by time
$URL = '
PHP data type conversions are cast, and PHP data types that allow conversion are:
1. (int), (integer): Convert to Plastic2. (float), (double), (real): Convert to floating point type3. (string): Convert to String4. (bool), (Boolean): Convert to
There is only one php_pdo_odbc.dll.
So~ the newest and best PHP connection MSSQL method should be this:
Copy Code code as follows:
$CNX = new PDO ("Odbc:driver={sql Server}"; server=127.0.0.1;database=test; ", ' sa ', ' asd123 ');
The example in this article describes the way PHP intercepts Chinese by character without garbled characters. Share to everyone for your reference. The implementation method is as follows:
$str number of characters, resulting in unnecessary
This example describes how PHP uses Numberformatter to format money. Share to everyone for your reference. The implementation methods are as follows:
$amount = ' 12345.67 ';
$formatter = new Numberformatter (' EN_GB ', numberformatter::currency)
Now there is a MySQL database in the test table has a Duration field, which has three records:
00:22:32
13:42:21
134:42:21
Represents the time length, however, the save type is text.
Now, how do you add these records in PHP and end up as a
The example in this article describes how PHP determines whether two floating-point numbers are equal. Share to everyone for your reference. The specific analysis is as follows:
Because floating point number directly with = = To determine whether
svnpeer.php
Copy Code code as follows:
/**
*
* This class to execute the external program of SVN
*
* @auth Seven Yang
*
*/
Class Svnpeer
{
/**
* List directory entries in the repository
*
* @param string a specific project
Find a solution on the Web:
Copy Code code as follows:
/* Processing Json_encode Chinese garbled * *
$data = Array (' Game ' => ' ice Fire country ', ' name ' => ' thorn spirit ', ' Country ' => ' frost State ', ' level ' => 45);
echo
usually with Number_format (); To format numbers, the default thousand are separated by commas, such as:
Copy Code code as follows:
Echo Number_format ("10000.01231", 2);
2 digits after the decimal point, the output result is: 10,000.1000
This example describes how PHP finds the location of a string by Strpos. Share to everyone for your reference. The specific analysis is as follows:
Strpos is used to find the first occurrence of a string in another string, Strpos case-sensitive,
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