The article about PHP optimization is often to teach you how to write efficient code, this article intends to discuss the problem from another perspective, teach you how to configure an efficient environment, so the same can achieve the goal of
$a = 123.666;
printf ("%.2f", $a);
$b = 10.85;
Print ("
");
printf ("%.1f", $b);
Why is the result
123.67
10.8
The last one rounded up, the latter one not?
Reply to discussion (solution)
printf ("%.1f%.16f", 10.85, 10.85); 10.8 10.849999999
The chmod () function is disabled by the server
Upload file not even Read permission
Assuming that the server configuration is not changed, in the program, there is no way to solve
Reply to discussion (solution)
Contact your server
if (Ini_get (' MAGIC_QUOTES_GPC '))
and the following paragraph.
if (Ini_get (' MAGIC_QUOTES_GPC ')) {
function stripslashesrecursive (array $array) {
foreach ($array as $k = = $v) {
if (is_string ($v)) {
$array [$k] = stripslashes ($v);
} else if
First of all, the definition, the first to look at the use of the scene, these definitions, Lao Meng, from the scene to think of design patterns is clearly a better way to understand.
Scenario: The new username is registered to complete the work: 1
I have an array as follows
$arr = Array (1,2,3,4,5,6,7,8);
Want to use loop output
Start1
1
2
3
4
End1
Start2
1
2
3
4
End2
----------------------------------------------------------
Start1
5
6
7
8
End1
Start2
5
6
7
8
End2
It means to group each
echo (int) ((0.1+0.7) * 10); Showing 7
echo (int) ((0.2+0.7) * 10); Showing 9
?>
Why is the result of the first article not 8?
Reply to discussion (solution)
On the accuracy of floating-point numbers
printf ('%0.16f ', (0.1+0.7) * 10);//7.999
This article introduces you to Configure:error:Cannot find Php-config. Please use the--with-php-config=path Error resolution method.
Configure:error:Cannot find Php-config. Please use--with-php-config=path
This error generally occurs when you
Project error, but run the page blank, do not know where the wrong.
in php.ini error_reporting = E_all Modified
Run discovery or no error prompt after reboot
Reply to discussion (solution)
Display_errors = OnSo you can see the error
thinkphp How to implement the domain name with a different length of string, enter a different controller method
For example:
Coding1 a string of 5-bit letters plus numbers
Coding2 a string of 6-bit letters plus numbers
How to implement the A
Take two sets of data from the two tables and deposit them $malls and $mall separately _tems
It is now necessary to traverse the comparison of two arrays, and if the record color_id and size_id are the same, take out the price value of the $mall
Regular expressions are a relatively difficult part of PHP beginners to face, time long often will be the role of all kinds of symbols forgotten. But after a systematic summary, you will find that the difficulty of memory is not very large.
Perl is
I'm doing it. A parody of beauty said jquery+ajax+php implementation of the "Like" rating feature has now been done to click on the image "like" the number of changes.
When you click on a color picture, the picture becomes another gray, and the
@mysql_connect ("localhost", "root", "DS130901881") or Die ("Database error");
@mysql_select_db ("project") or Die ("MySQL error");
Mysql_set_charset ("GBK");
if (!empty ($_post[' Sub ')) {
$title =$_post[' title ';
$con =$_post[' con '];
$sql =
There are a lot of pictures, sorry ah ....
I configured it on a Web-based tutorial,
First appear a figure, feel fast success, and then input php_info.php, want to see that configuration information, on 404,
I thought it was my PHP document wrong,
I don't know what this interceptor can do to get a variable.
Interceptor (__set) Private function __set ($_key, $_value) {$this->$_key = $_value;} Interceptor (__get) Private function __get ($_key) {return $this->$_key;}
Reply to discussion (
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