Using Memcache in PHP
1. Test code
This is memcache official test memcache code
Set ("Str_key", "String to store in memcached"), $memcache->set ("Num_key", 123); $object = new StdClass; $object attribute = ' Test '; $memcache->set
Creating variables
PHP does not have a command to create a variable, it is created when the first assignment is made, and is automatically converted to the correct data type.
PHP Naming conventions:
The variable starts with the $ sign,
Would you like to ask if PHP has such an array function
Known quantity group
$a [' A ']=> ' apple ', $a [' B ']=> ' banana, $a [' P ']=> ' pear '
An array is known
$key = Array (' A ', ' B ', ' P ');
Get the value of the corresponding array of
The value of the $r [title] is Youku or Tudou or Qiyi
But there are variables, how to add quotation marks and the like is not, to solve
Reply to discussion (solution)
R[title]. '. Php
Include ("$r [title].php");You have no problem writing
The configuration of Smarty is not to be said here. Let's talk about two of these functions here.
(1) Assign method
Assign is used to assign values to template variables when the template is executed, with the following syntax:
{Assign var = ""
A seating chart, a student table
Seating chart:
ID Zid UserID
Student table:
UserID Cityid
Now I want to randomly write the student table students to the seating chart, seating chart Zid is a 2 digit seat number
For example, the student
I recently need to build an iOS app backstage, the application has the social tool general function, php+apache+mysql How to set up the background, is the application needs to read the data in the MySQL data in PHP, to the JSON format to send to the
I'm sorry, I'm very busy recently, there is no time to update the content ha.
The previous article "Typecho Theme production file Structure" introduces the template file needed to make Typecho theme, which has a special file called "Skin function",
I use PHP to parse the database, from the database to get the data garbled, can be sure, the page encoding is utf-8 no problem (with echo "Hello!" "Tested, can be printed out," is not a database encoding problem, because the database is UTF8 encoded,
System: OS X Yosemite 10.10.1
The system comes with PHP and PHP-FPM
Path NOTES:
PHP.ini:/etc/
Php-fpm.conf:/etc/
Nginx.conf:/usr/local/etc/nginx/nginx.conf
Nginx Default root:/usr/local/opt/nginx/html
1. Install Nginx, I use brew
Brew
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
When debugging "personal blog site", the PHP code has some problems, look at the Master guide Ah
Reply to discussion (solution)
The first is because you passed in a string, prompting you to pass in an array; the second and third is that you
Statement: This series of blog reference "Big Talk design mode", author Geoscience.
Singleton mode, also known as the single State, is the simplest of 23 design patterns, from his name can know his core ideas, single-case mode is only one such
Previously wrote a php-fpm optimization method
"WARNING: [pool www] seems busy (php-fpm need to increase pm.start_servers, or pm.min/max_spare_servers) appears in the log of a test machine , spawning 8 children, there is 0 idle, and 6 total
PHP core Technology and the serialization of best practice objects
An object is a heap of data that can be stored for use when needed, which is the serialization of an object.
Serialization is the preservation of various object States
I installed Wamp on the server side, the port is set to 6666 configuration good site, the computer through the local area network can be accessed, the address is 10.10.10.**:6666, Web page display no problem. However, the phone is connected to the
The same code under Windows Aparhe Server is running normally, there is a problem under the CentOS Nginx. specific as follows;
$_session[' username ' in a.php cannot be used in b.php. The session IDs in the test two PHP files are the same.
Online 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