In fact, this is not difficult, because just started CI, so still a little trouble. Fortunately there are manuals.
Locate the database configuration file and add the connection information for a new library. $config [XX].
Inside the controller,
a)
At this point, the Is_scalar built-in function comes in handy.
Is_scalar--Detects whether a variable is a scalar
Scalar variables are variables that contain integers, float, string, or Boolean, while array, object, and resource are not scalars.
Copy Code code as follows:
$arr = Array (' A ', ' B ', ' C ', ' d ');
Unset ($arr [1]);
Print_r ($arr);
?>
Print_r ($arr), the result is not that, the end result is Array ([0] => a [2] => C [3] => D
So how do you get the missing
first, the entrance
The entry file can be a single file can also be multiple files, I now use the basic files, but the contents of the entry file is basically the same, for later changes in other ways of entry to do the basis,
Copy Code code
Copy Code code as follows:
? Php
Require_once ("mssql.class.php");
1. Create a class and connect to a database
$DB = new MSSQL ("Dns=aaa;uid=sa;pwd=sa;dbname=test");
2. Connecting to the database
$conn = $db->config ("Dns=aaa;uid=sa;pwd=sa;
Or, does the design of PHP itself avoid directly viewing the contents of a file? From a security standpoint, what protection does this system-level file have to do?
The answer of Perfect netizen
After investigation, the following common methods are
The main function is based on Beibei's date of birth to show Beibei now how big, real-time show beibei growth.
Use the current time minus the date of birth, but it can be shown how many years, months, and days.
The algorithm of the day is somewhat
This article illustrates the address transfer and value transfer usage of JavaScript arrays and PHP arrays. Share to everyone for your reference. Specifically as follows:
The JavaScript array is the address pass/reference pass, while the PHP array
Typically, when we want to generate a random string, we always create a character Fu Chi, then generate a PHP random number with a loop and Mt_rand () or rand (), randomly select characters from the character pool, and finally piece together the
PHP computes an array with the same number of occurrences, you can use PHP with its own function array_count_values:Description
The array array_count_values (array $input) Array_count_values () returns an array that uses the value in the input
This example describes how PHP uses regular expressions to get a picture URL. Share to everyone for your reference.
The implementation methods are as follows:
Copy Code code as follows:
Header ("Content-type:text/html;charset=utf-8");
This example describes the way PHP obtains IP addresses and regions via chianz.com. Share to everyone for your reference. The specific analysis is as follows:
The results of an IP acquisition is not perfect, the reason is because ip138 IP
1, the use of ++i (A=++i, i=2 as an example)
First add the I value by 1 (that is, i=i+1), and then assign the variable a (that is, a=i),
The final a value is equal to 3, and the I value equals 3.
So a=++i is equivalent to i=i+1, a=i
2, the
If we want to know who is calling a method? Debug_print_backtrace can solve
Debug_print_backtrace () can print a page of the call process, from where to go at a glance.
But this is a proprietary function of the PHP5, but in pear there is already a
See a problem on the Internet:
The result of Array ("a") +array ("B") is ___
A.array ("A", "B")B.array ("B", "a")C.array ("B")D.array ("a")
Answer: D
PHP two arrays added, why the result is still the same?
Because they are equivalent to array ("
1. Single quotation mark explosion path
Description
Add single quotes directly behind the URL, requiring that the single quotation mark not be filtered (Gpc=off) and that the server return the error message by
The example in this article tells you how to draw an arc in PHP. Share to everyone for your reference. Specifically as follows:
An arc is equivalent to intercepting part of an ellipse. The code is as follows:
Copy Code code as follows:
1.
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