mean?
function Getweek ($day) { $days = array (' Sunday ', ' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday '); return $days [Date (' W ', Strtotime ($day))];} $date = ' 2014-09-29 '; if ($w = Date (' W ', Strtotime ($date))) $date = Date (' y-m-d ', Strtotime ("-$w Day $date")), and for ($i = 0; $i
That's the effect, but what does the moderator define $date= ' 2014-09-29 ' do?
I understand that the landlord wants this week from Monday to Sunday ...
Header
'],86500); echo $_cookie[' username ']; The second way to set cookies: through the CI Framework Input class library $this->input->set_cookie ("username", $user _info[' username '],3600); $this->input->set_cookie ("password", $user _info[' password '],3600); $this->input->set_cookie ("user_id", $user _info[' user_id '],3600); echo $this->input->co
COOKIE named "User" by $HTTP _cookie_vars["user"] or $_cookie["user". When a cookie is sent, the value of the cookie is automatically URL-encoded. The URL is decoded when it is received. If you don't need this, you can use Setrawcookie () instead.
example, PHP settings and get cookie
Copy the Code code as follows:Setcookie (' MyCookie ', ' value ');
function prototypes: int Setcookie (string name,string value,int expire,string path,string domain,int Secure)Echo ($mycookie);Echo ($HTTP _cookie_v
Session usage:Session_start (); defines the $ _ SESSION array variable.Session_start () cannot be output in any form, including the output and html code in php.The $ _ SESSION array cannot use numeric subscript, but can only use string subscript.The session_save_path configuration item in php. ini determines the session storage location.By default, sessions are stored in files. We can use the session_set_save_handler () function to override the session mechanism.Set effective time The code is a
Use of Session:
Session_Start (); Defines the $_session array variable.
Session_Start () cannot have any form of output prior to use, including PHP output and HTML code.
$_session arrays cannot use numeric subscripts, only string subscripts can be used.
The Session_save_path configuration entry in php.ini determines where the session is saved.
By default, the session is saved in a file. We can use the Session_set_save_handler () function to rewrite the session mechanism.
Set valid time
$HTTP _cookie_vars["user" or $_cookie["user". When a cookie is sent, the value of the cookie is automatically URL-coded. The URL is decoded when it is received. If you do not need this, you can use Setrawcookie () instead.
example, PHP settings and get cookies
Copy Code code as follows:
Setcookie (' MyCookie ', ' value ');
function prototypes: int Setcookie (string name,string value,int expire,string path,string Secure)Echo ($mycookie);Echo ($HTTP _cookie_vars[' MyCookie
sec)
mysql> use users;
Database changed
Mysql> CREATE TABLE info (FirstName varchar), LastName varchar (40),
Email varchar (+), Count varchar (3));
Query OK, 0 rows affected (0.05 sec)
OK, now that we have the required table, we can build a PHP page against the database to check cookies.
####################### #index. php##################################
? if (Isset ($Example)) {//begin Instructions for existing Cookie
$info = Explode ("", $Example);
$FirstName = $info [0];
$LastName = $i
Label:People doing database development or management often want to create a large number of test data, there will be tens of thousands of things, if one entry, it will waste a lot of time, this article describes how Oracle in a SQL to quickly generate a large number of test data method. First, simulate 100 random data. [SQL]View Plaincopyprint?
Select RowNum as ID,
To_char (sysdate + rownum/24/3600, ' yyyy-mm-dd hh24:mi:ss ') as Inc_dat
server.
Application:
For a website to be registered, the user's identity will be automatically identified and sent to it for information. if it is a stranger, the user will be told to register first. Follow the information below to create a small data database: first name, last name, email address, and counter ).
Follow these steps to create a table:
MySQL> create database users;
Query OK, 1 row affected (0.06 sec)
Mysql> use users;
Database changed
Mysql> create table info (FirstName varch
> use users;Database changed
Mysql> Create Table Info (firstname varchar (20), lastname varchar (40 ),Email varchar (40), Count varchar (3 ));Query OK, 0 rows affected (0.05 Sec)
Now we have a qualified table. We can create a PHP page to check cookies against the database.
######################## Index. PHP ##################################$ Info = explode ("", $ example );$ Firstname = $ info [0];$ Lastname = $ info [1];$ Email = $ info [2];$ COUNT = $ info [3];$ Count ++;
$ Cookiestri
['mycooker']);
Delete Cookie
(1) Call setcookie () with only the name parameter ();(2) set the expiration time to time () or time-1;
The code is as follows:
Setcookie ('mycookier'); or setcookie ('mycookier', ''); or setcookie (" mycookie ", false );// Setcookie ('mycooker', '', time ()-3600 );Echo ($ HTTP_COOKIE_VARS ['mycooker']);Print_r ($ _ COOKIE );
Recommended deletion methods:
The code is
= time (); // Current date $ diff = $ now-$ past; // difference echo 'published on '. time2Units ($ diff ). 'pre';?>
In other words, I think it is better:
Function time_tran ($ the_time) {$ now_time = date ("Y-m-d H: I: s", time () + 8*60*60 ); $ now_time = strtotime ($ now_time); $ show_time = strtotime ($ the_time); $ dur = $ now_time-$ show_time; if ($ dur
5. calculate the time difference based on the difference
Function getTime ($ val) {if ($ val> 0) {$ nTime ['nday'] = (int) ($ val/(
() with only the name parameter ();
(2) set the expiration time to time () or time-1;
The code is as follows:
Setcookie ('mycookier'); or setcookie ('mycookier', ''); or setcookie (" mycookie ", false );
// Setcookie ('mycooker', '', time ()-3600 );
Echo ($ HTTP_COOKIE_VARS ['mycooker']);
Print_r ($ _ COOKIE );
It is recommended to delete the code as follows:
Setcookie ('mycooker', '', time ()-
options is changed, a completely different cookie is created, for example, the name value is changed.
Cookie expiration time:
You can set the expiration time. if you do not set the expiration time, it is the session level, that is, closing the browser will disappear. When a cookie is created, it contains an expiration date, which is associated with a cookie identified by name-domain-path-secure. To change the expiration date of a cookie, you must specify the same combination. When changing the
// Char * mapno: Image number
// Int lon_deg: longitude-degree
// Lon_min: longitude-Score
// Lon_sec: longitude-second
// Lat_deg: latitude-degree
// Lat_min: latitude-Score
// Lat_sec: latitude-second
// Long lscale: Scale
Bool trans (char * mapno, int lon_deg, lon_min, lon_sec, lat_deg, lat_min, lat_sec, long lscale)
{Int scaleid;Char Buf [10];Char s [] = "abcdefghijklmnopqrstuv"; // the latitude of the am topographic map is subject to a QR code.Long Scale [] = {,}; // image
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.