php5.0 to connect data with previous methods$con =mysqli_connect ("localhost", "My_user", "My_password", "my_db");Always appear warning! Please use PDO and mysqli.Then I'll rewrite it with mysqli .$conn = new Mysqli ("localhost", "root", "123", "DB")
Redis is a key-value storage system. Similar to Memcached, Memcached supports more storage value types, including string, list, set, and zset ). These data types support push/pop, add/remove, Intersection Set and difference set, and more abundant
Variables uploaded to the Smarty template on the PHP page (here, two variables are created on the Smarty)Copy codeThe Code is as follows:{Assign var = "name" value = 'Richard. Lil '}{Assign var = "age" value = '27 '}1. output in a certain position
You can modify the code and add some judgments:
Copy codeThe Code is as follows:If (empty ($ _ POST ['name']) {Echo "as the saying goes, wild goose swordsmanship is too famous ";}
Elseif (empty ($ _ POST ['comment']) {Echo "low oil, just say a few
In php, Chinese Character regular expressions may be very simple for some friends, but during use, we will find that the gbk encoding and uft8 encoding may be a little different. The following is a small series to introduce.Chinese character Regular
Use ZipArchive to compress the file. This is an extension class of php. It has been supported since php5.2. If an error occurs during use, check php. in ini, have you removed the semicolon before extension = php_zip.dll, and then restart Apache to
For URL encoding in PHP, urlencode () or rawurlencode () can be used. The difference between the two is that the former encodes spaces into '+ ', the latter encodes spaces into '% 20', but it should be noted that only part of the URL should be
Code 1:Generate a random password function. The generated password is a random string of lowercase letters and numbers. The length can be customized. Relatively speaking, this is relatively simple
Copy codeThe Code is as follows:/** Php
To be as efficient as possible, retrieve the file extension from a standard url, and then extend the code to get other data, such as directory path, the principle is to use the explode function of PHP to separate strings.Example:
The page flip file loads all the content at a time, so it is not very suitable for large websites, but suitable for scenarios with less data.In this example, no database is used. PHP CodeCopy codeThe Code is as follows: JavaScript
When we use thinkphp for development, sometimes we use the getById ('1') method to quickly obtain a piece of information. This method is better than where ("id = 1 ") -> find () is much easier to use, and the query efficiency is faster than find.
Recently, curl ERROR: Recv failure: Connection reset by peer is reported in CURL. The solution is shared with you and I hope to help you.
We often use curl to access web sites. Currently, web sites are mainly divided into http and https protocols.
The ThinkPHP template engine provides a wide range of comparison labels. The usage format is as follows:
content
The comparison labels supported by ThinkPHP and their meanings are as follows:
Eq or equal: equalNeq or notequal: not equalGt:
When I recently voted for a website, I encountered a conflict between the cookie and session in ThinkPHP that caused the Cookie to be unavailable.The website uses the ThinkPHP framework. Many images are displayed on one page, requiring a vote under
Medoo Introduction
Medoo is a lightweight php SQL database framework developed by Li yanzhuo, a social networking website Catfan and founder of Qatrix, an open-source project. It provides simple, easy to learn, and flexible APIs to improve the
Php Chinese character to PinYin
Php functions (modified by the SpGetPinyin function of dedecms (dedecms/include/inc/inc_fun_funAdmin.php). The Dictionary of dedecms is incomplete ):
0x80) {$ c = $ str [$ I]. $ str [$ I + 1]; $ I ++; if (isset ($
Obtain all sub-classes of a category:
Static function getMenuTree ($ arrCat, $ parent_id = 0, $ level = 0, $ all = True) {static $ arrTree; // use static instead of global if (! $ All) $ arrTree = ''; if (empty ($ arrCat) return FALSE; $ level ++;
In PHP, how does one batch Delete objects? Code
Recently, I was working on a project, but batch deletion never worked. I pasted the code below. You guys can help me see where the problem is. Thank you again!
// 1. Batch Delete
If ($ _ POST ["chk"]
After loading a frameset framework template when writing code with notepad ++ today, this page is not displayed on the page, and it is normal after you view the source code. Then, simply delete all the items in it and write a few test texts to
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