PHP url rewriting file (. htaccess) brings us great convenience, as long as the following code can achieve non-www 301 jump.
The Code is as follows:
Copy code
1. RewriteCond % {HTTP_HOST} ^ bKjia. c0m $ [NC]2. RewriteRule ^ (. *) $ http://www.bKjia. c0m/$1 [L, R = 301]
. Htaccess setting 301 method, old domain name to new domain name
Setting method:
The Code is as fo
Php image watermark Chinese garbled solution. Php image watermark Chinese garbled solution is to transfer a Chinese font to Morocco, if you did not load the relevant font when generating the watermark with Chinese characters, the Chinese character will certainly be a php image Watermark. The Chinese garbled solution is to transfer a Chinese font to Morocco. if you do not load the relevant font when the watermark is generated with Chinese characters, chinese characters will certainly be garbled.
This article introduces the usage of parse_url () function in php. If you need parse_url () function, refer to this article.
A useful function in PHP, parse_url, is particularly convenient for information capture analysis. For example:
The Code is as follows:
Copy code
$ Url = "http://www.bKjia. c0m/aaaa/"; $ parts = parse_url ($ url );Output:Array([Scheme] => http[Host] => www. bKjia. c0m
Php Cache Technology example the php cache technology mentioned in this Article is to generate a temporary cache file for data and save it to the hard disk, then, delete the cached file and generate a new cache file based on the time set for the cached file.
Php tutorial Cache Technology exampleThe php cache technology mentioned in this Article is to generate a temporary cache file for data and save it to the hard disk. Then, delete the cache file according to the time set by the cache file to g
Code of the previous and next articles in the php tutorialBasic knowledge:
Order by id desc or order by id asc is performed on the id pair, and then the result is judged to be smaller than the current id> or than the current Article id.The SQL statement of the instance is as follows:
Select * from news where id Select * from news where id> $ id order by id desc limit 0, 1
---- Table structure 'string _ find'--
Create table if not exists 'string _ find '('Id' int (4) not null auto_increment,'Char
Adding watermarks to images is something that many websites will do. The following code only supports adding text watermarks to images. Currently, only English is supported, if you want this program to support Chinese characters, set $ font = \ 'verdana. ttf \ '; it is OK to call a Chinese font.
Php Tutorial: Add text watermark code to images/*Adding watermarks to images is something that many websites will do. The following code only supports adding text watermarks to images. Currently, only En
Php image watermark Chinese garbled solution is to transfer a Chinese font to Morocco, if you did not load the relevant font when generating the watermark with Chinese characters, chinese characters will certainly be garbled. If it is English letters, it does not matter if it is not loaded.
Php tutorial image watermark Chinese garbled SolutionI want to transfer a Chinese font to Morocco. If you didn't load the relevant font when generating a watermark that contains Chinese characters, the Chines
Image Watermark code for a super simple php tutorialAdd imagecreatefromjpeg imagecreatefroatefrompng imagecopymerge imagejpeg to the image in php. As long as you set the source image and the watermark image, see the example below.*/
Header ("content-type: image/jpeg ");
$ Filename = 'temp/www. bKjia. c0m/zhutiai.com.jpg ';
$ Im = imagecreatefromjpeg ($ filename );
$ S = imagecreatefrompng ('mb. bKjia. c0
function to implement the fsockopen function. Refer to the Code:
The Code is as follows:
Copy code
Function B _fsockopen ($ host, $ port, $ errno, $ errstr, $ timeout ){$ Ip = gethostbyname ($ host );$ S = socket_create (AF_INET, SOCK_STREAM, 0 );If (socket_set_nonblock ($ s )){$ R = @ socket_connect ($ s, $ ip, $ port );If ($ r | socket_last_error () = EINPROGRESS ){$ Errno = EINPROGRESS;Return $ s;}}$ Errno = socket_last_error ($ s );$ Errstr = socket_strerror ($ err
In php, the curl module is a multi-thread module that can easily simulate logon, such as post and get, the following example uses the curl module to simulate the collection page program after logon.
My homework today is to get product inventory from a website, but this website needs to be logged on. I used fsockopen to pass the entire header, and it was useless. I had to turn to curl for help.
The following describes how to enable the curl module:
(1) Copy libeay32.dll and ssleay32.dll from the
use the return statement to specify the return value, or it can return no value. When a function is executed to a return statement, the execution of the function is completed regardless of the Code.JavaScript function callAfter the function is defined, you can call it. When calling a function, you only need to add parentheses after the function name.
If the defined function needs to pass parameters, you need to add parameters in parentheses. Multiple parameters are separated by commas. The para
SQL query statements that start with a specified characterFor example, many times we have to go to the mysql tutorial and use mssql to query Qualified Data. Today I have encountered a query of all qualified records starting with "Deng.I used two query methods to view the instance.First, log in to a database tutorial cc,Create database cc;Create a tableCreate table if not exists 'string _ find '('Id' int (4) not null auto_increment,'Charlist' varchar (100) default NULL,Primary key ('id ')) ENGINE
This article will give you a summary of the js array operation examples. These are basic js array operation methods. I hope this tutorial will be helpful to you.
1. Create an array
Var arr = []; // create an empty arrayVar arr1 = new Array (5); // create an Array and assign 5 lengths (null)Var arr2 = new Array ('php blog', 'javascript blog', 'mysql blog ','. net blog ', 'it blog'); // create an array with values
2. Read the value of the array
Var arr2 = new Array ('php blog ', 'javascript blog',
. c0m">/etc/rsync. passChmod 600/etc/rsync. pass
6. Create a synchronization Directory: the directory in the path configuration option in step 1.Mkdir/home/Seeyon
7. Start rsyncCopy codeRsync -- daemon -- config =/etc/rsyncd. conf (run rsync in the background)Restart xinetd.
Systemctl restart xinetd (restart)Systemctl stop xinetd (stop)Systemctl start xinetd (start)
8. Check whether the startup is successful.Netstat-anutp | grep 873If the following da
Add a webpage to the desktop shortcut in php. We often see on the website that we can directly save the website to our computer in a shortcut, and then click it to access the network, in php, how to add a webpage to our website is often seen on the website. we can directly save the website to our computer in a shortcut, and then click it to access the network, in php, how does one add a webpage to the desktop shortcut.
Simple functions and direct code.
The code is as follows:
Very practical PHP code snippets (recommended ). There are many PHP code snippets on the Internet that can improve development efficiency. you can also learn the skills and apply them to your own projects, I love boiled fish and I have selected several useful PHP code snippets on the Internet to improve development efficiency. I can also learn the skills and apply them to my own projects, below I love boiled fish to select a few useful PHP fragments.
Extract keywords from webpages
Extract and di
The mssql data instance is displayed in the php connection query. The php connection query shows that the mssql data instance feels that the php and mysqlmssql database processing functions only have different prefixes. here we can see the instance. The connection query in the php Tutorial shows that the mssq php connection query shows the mssql data instance // it feels that the processing functions of php and mysql mssql databases only have different prefixes. here we will see the instance.
Ph
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.