<< < 1 2 3 4 5 6 7 8 9 10 11 > >>   Sort: Date

How To Remove a Cookie
How To Remove a Cookie? - PHP Script Tips - Understanding and Managing Cookies Once a cookie is sent from the server to the browser, there is no direct way for the server to ask the browser to remove the cookie. But you can use the setcookie() function to send the same cookie to browser with a negat...
2007-04-24, 4829👍, 0💬

How To Get the Total Number of Values in an Array
How To Get the Total Number of Values in an Array? - PHP Script Tips - PHP Built-in Functions for Arrays You can get the total number of values in an array by using the count() function. Here is a PHP example script: &lt;?php $array = array("PHP", "Perl", "Java"); print_r("Size 1: ".count($array...
2007-04-20, 4823👍, 0💬

How To Check Your PHP Installation
How To Check Your PHP Installation? - PHP Script Tips - Downloading and Installing PHP PHP provides two execution interfaces: Command Line Interface (CLI) and Common Gateway Interface (CGI). If PHP is installed in the \php directory on your system, you can try this to check your installation: Run "\...
2007-04-22, 4821👍, 0💬

How To Turn on mysql Extension on the PHP Engine
How To Turn on mysql Extension on the PHP Engine? - MySQL FAQs - PHP Connections and Query Execution The "mysql" API extension is provided as "php_mysql.dll" for Windows system. Your PHP binary download package should have "php_mysql.dll" included. No need for another download. But you need to check...
2007-05-10, 4820👍, 0💬

How To Convert Strings to Numbers
How To Convert Strings to Numbers? - PHP Script Tips - Understanding String Literals and Operations In a numeric context, PHP will automatically convert any string to a numeric value. Strings will be converted into two types of numeric values, double floating number and integer, based on the followi...
2007-04-20, 4820👍, 0💬

How To Convert Numbers to Strings
How To Convert Numbers to Strings? - PHP Script Tips - Understanding String Literals and Operations In a string context, PHP will automatically convert any numeric value to a string. Here is a PHP script examples: &lt;?php print(-1.3e3); print("\n"); print(strlen(-1.3e3)); print("\n"); print("Pr...
2007-04-20, 4814👍, 0💬

How To Test Persistent Cookies
How To Test Persistent Cookies? - PHP Script Tips - Understanding and Managing Cookies If you want to test persistent cookies, you can copy the following PHP script, setting_persistent_cookies.php ,to your Web server: &lt;?php setcookie("LoginName","FYICent er");setcookie("PreferredColor","Bl ue"...
2007-04-25, 4813👍, 0💬

How Arrays Are Passed Through Arguments
How Arrays Are Passed Through Arguments? - PHP Script Tips - Creating Your Own Functions Like a normal variable, an array is passed through an argument by value, not by reference. That means when an array is passed as an argument, a copy of the array will be passed into the function. Modifying that ...
2007-04-24, 4810👍, 0💬

Which HTML Tag Allows Users to Specify a File for Uploading
Which HTML Tag Allows Users to Specify a File for Uploading? - PHP Script Tips - Uploading Files to Web Servers To present an input field on your Web page to allow users to specify a local file to upload, you need to use the &lt;INPUT TYPE="FILE" ...> tag inside a &lt;FORM ...> tag. The &...
2007-04-19, 4810👍, 0💬

What Is a Persistent Cookie
What Is a Persistent Cookie? - PHP Script Tips - Understanding and Managing Cookies A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. By default, cookies are created as temporary cookies which stored only in the browser's memory. When the browser...
2007-04-25, 4807👍, 0💬

Where Are the Session Values Stored
Where Are the Session Values Stored? - PHP Script Tips - Understanding and Using Sessions When a value is saved into the current session by one PHP page, the PHP engine must stored this value somewhere on Web server, so that the PHP engine can retrieve it back when same visitor comes back to request...
2007-04-18, 4804👍, 0💬

What Is the Common Mistake When Setting Path and Domain on Temporary Cookies
What Is the Common Mistake When Setting Path and Domain on Temporary Cookies? - PHP Script Tips - Understanding and Managing Cookies A common mistake made by many PHP developers is using an empty string for the expiration time parameter when setting path and domain for temporary cookies. The PHP scr...
2007-04-24, 4803👍, 0💬

How To Test If a Variable Is an Array
How To Test If a Variable Is an Array? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations Testing if a variable is an array is easy. Just use the is_array() function. Here is a PHP script on how to use is_array(): &lt;?php $var = array(0,0,7); print("Test 1: ". is_array($var...
2007-04-20, 4803👍, 0💬

How To Specify Argument Default Values
How To Specify Argument Default Values? - PHP Script Tips - Creating Your Own Functions If you want to allow the caller to skip an argument when calling a function, you can define the argument with a default value when defining the function. Adding a default value to an argument can be done like thi...
2007-04-25, 4798👍, 0💬

How To Append New Data to the End of a File
How To Append New Data to the End of a File? - PHP Script Tips - Reading and Writing Files If you have an existing file, and want to write more data to the end of the file, you can use the fopen($fileName, "a") function. It opens the specified file, moves the file pointer to the end of the file, and...
2007-04-22, 4796👍, 0💬

How To Open Standard Output as a File Handle
How To Open Standard Output as a File Handle? - PHP Script Tips - Reading and Writing Files If you want to open the standard output as a file handle yourself, you can use the fopen("php://stdout") function. It creates a special file handle linking to the standard output, and returns the file handle....
2007-04-23, 4795👍, 0💬

How To Take a Substring from a Given String
How To Take a Substring from a Given String? - PHP Script Tips - PHP Built-in Functions for Strings If you know the position of a substring in a given string, you can take the substring out by the substr() function. Here is a PHP script on how to use substr(): &lt;?php $string = "beginning"; pri...
2007-04-21, 4795👍, 0💬

How To Read a Text File into an Array
How To Read a Text File into an Array? - PHP Script Tips - Reading and Writing Files If you have a text file with multiple lines, and you want to read those lines into an array, you can use the file() function. It opens the specified file, reads all the lines, puts each line as a value in an array, ...
2007-04-22, 4788👍, 0💬

How To Remove Values Saved in the Current Session
How To Remove Values Saved in the Current Session? - PHP Script Tips - Understanding and Using Sessions If you want to remove values saved in the current session, you should use the unset() function on those saved values in $_SESSION, or use array() to empty $_SESSION: unset($_SESSION['MyColor']) - ...
2007-04-17, 4788👍, 0💬

What Is an Array in PHP
What Is an Array in PHP? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations An array in PHP is really an ordered map of pairs of keys and values. Comparing with Perl, an array in PHP is not like a normal array in Perl. An array in PHP is like an associate array in Perl. But an a...
2007-04-20, 4787👍, 0💬

How Cookies Are Transported from Browsers to Servers
How Cookies Are Transported from Browsers to Servers? - PHP Script Tips - Understanding and Managing Cookies Cookies are transported from a Web browser to a Web server in the header area of the HTTP request message. Each cookie will be included in a separate "Cookie:" header line in the following fo...
2007-04-24, 4786👍, 0💬

How To Specify Domain and Path for a Cookie
How To Specify Domain and Path for a Cookie? - PHP Script Tips - Understanding and Managing Cookies If you want to specify domain and path for cookie, you can use the setcookie() function with two extra parameters. The sample PHP script below shows you how to set the domain and path attributes for t...
2007-04-24, 4778👍, 0💬

How View the Content of a Cookie File
How View the Content of a Cookie File? - PHP Script Tips - Understanding and Managing Cookies Cookie files are normal text files. You can view them with any text editor. Follow the steps below to see what is in a cookie file created by your own PHP script. Copy the following sample script, setting_p...
2007-04-24, 4777👍, 0💬

What Is a Session ID
What Is a Session ID? - PHP Script Tips - Understanding and Using Sessions A session ID is an identification string of a session. Since there might be multiple visitors coming to your Web site at the same time, the PHP engine needs to maintain multiple sessions concurrently. Session IDs are created ...
2007-04-18, 4773👍, 0💬

<< < 1 2 3 4 5 6 7 8 9 10 11 > >>   Sort: Date