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

Testing the Session Garbage Collection Process in PHP
How To Test the Session Garbage Collection Process in PHP? In order to test the session garbage collection process, you need to change the settings to expire session variables in 10 seconds and run the process on every request: session.gc_probability = 1 session.gc_divisor = 1 session.gc_maxlifetime...
2016-10-24, 1568🔥, 0💬

Turning on the Session Support in PHP
How To Turn on the Session Support in PHP? The session support can be turned on automatically at the site level, or manually in each PHP page script: Turning on session support automatically at the site level: Set session.auto_start = 1 in php.ini. Turning on session support manually in each page sc...
2016-10-29, 1566🔥, 0💬

What Is an Array in PHP
What Is an Array in PHP? 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 array in PHP can work like a normal array in Perl. Comparing with Java, a...
2016-10-15, 1560🔥, 0💬

Converting Strings to Upper/Lower Case in PHP
How To Convert Strings to Upper or Lower Cases? Converting strings to upper or lower cases are easy. Just use strtoupper() or strtolower() functions. Here is a PHP script on how to use them: &lt;?php $string = "PHP string functions are easy to use."; $lower = strtolower($string); $upper = strtou...
2016-10-13, 1559🔥, 0💬

Copying a File in PHP
How To Copy a File in PHP? If you have a file and want to make a copy to create a new file, you can use the copy() function. Here is a PHP script example on how to use copy(): &lt;?php unlink("/temp/myPing.exe"); copy("/windows/system32/ping.e xe","/temp/myPing.exe"); if (file_exists("/temp/myPi...
2016-11-20, 1554🔥, 0💬

Using Cookies to Transfer Session IDs in PHP
How To Force the PHP Engine to Use Cookies to Transfer Session IDs in PHP? If you want to force your PHP engine to use cookies to transfer session IDs instead of URL parameters, you can open the PHP configuration file, php.ini, and make the following changes: session.use_cookies = 1 session.use_only...
2016-10-25, 1552🔥, 0💬

Comparing Two Strings in PHP
How To Compare Two Strings with Comparison Operators? PHP supports 3 string comparison operators, &lt;, ==, and &gt;, that generates Boolean values. Those operators use ASCII values of characters from both strings to determine the comparison results. Here is a PHP script on how to use compar...
2016-10-13, 1550🔥, 0💬

Creating a Table in PHP
How To Create a Table in PHP? If you want to create a table, you can run the CREATE TABLE statement as shown in the following sample script: &lt;?php include "mysql_connection.php"; $sql = "CREATE TABLE fyi_links (" . " id INTEGER NOT NULL" . ", url VARCHAR(80) NOT NULL" . ", notes VARCHAR(1024)...
2016-10-20, 1546🔥, 0💬

Removing a Cookie in PHP
How To Remove a Cookie in PHP? 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 negative expiration time, which will cause the browse...
2016-11-03, 1545🔥, 0💬

Defining an Argument as a Reference in PHP
Can You Define an Argument as a Reference Type? in PHP? You can define an argument as a reference type in the function definition. This will automatically convert the calling arguments into references. Here is a PHP script on how to define an argument as a reference type: &lt;?php function ref_s...
2016-12-24, 1543🔥, 0💬

Querying Multiple Tables Jointly in PHP
How To Query Multiple Tables Jointly in PHP? If you want to query information stored in multiple tables, you can use the SELECT statement with a WHERE condition to make an inner join. Assuming that you have 3 tables in a forum system: "users" for user profile, "forums" for forums information, and "p...
2016-10-17, 1543🔥, 0💬

Inserting Data into a Table in PHP
How To Insert Data into a Table in PHP? If you want to insert a row of data into a table, you can use the INSERT INTO statement as shown in the following sample script: &lt;?php include "mysql_connection.php"; $sql = "INSERT INTO fyi_links (id, url) VALUES (" . " 101, 'dev.fyicenter.com')"; if (...
2016-10-20, 1542🔥, 0💬

Input Values of SELECT Tags in PHP
What Are Input Values of SELECT Tags in PHP? SELECT tags are used in forms to provide dropdown lists. Entries in a dropdown list are defined by OPTION tags, which can provide input values in two ways: Implicit value - Provided as &lt;OPTION&gt;input_va lue&lt;/OPTION&gt;,where input_...
2016-11-13, 1541🔥, 0💬

Opening a File for Writing in PHP
How To Open a File for Writing in PHP? If you want to open a new file and write date to the file, you can use the fopen($fileName, "w") function. It creates the specified file, and returns a file handle. The second argument "w" tells PHP to open the file for writing. Once the file is open, you can u...
2016-12-02, 1540🔥, 0💬

Writing an Array to a File without File Handle in PHP
How To Write an Array to a File without a File Handle in PHP? If you have an array, want to write it to a file, and you don't want to open the file with a file handle, you can use the file_put_contents(). It opens the specified file, writes all values from the specified string, closes the file, and ...
2016-11-27, 1537🔥, 0💬

Escape Sequences in Single-Quoted Strings in PHP
How Many Escape Sequences Are Recognized in Single-Quoted Strings? There are two special characters you need to escape in a single-quote string: the single quote (') and the back slash (\). Here is a PHP script example of single-quoted strings: &lt;?php echo 'Hello world!'; echo 'It\'s Friday!';...
2016-10-13, 1536🔥, 0💬

Cookies Transported from Browsers to Servers in PHP
How Cookies Are Transported from Browsers to Servers in PHP? 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 format: GET / HTTP/1.1 Cookie: name1=value1 Cookie...
2016-11-02, 1535🔥, 0💬

Global Variables in Main Script in PHP
What Is the Scope of a Variable Defined outside a Function? in PHP? A variable defined outside any functions in main script body is called global variable. However, a global variable is not really accessible globally any in the script. The scope of global variable is limited to all statements outsid...
2016-12-08, 1534🔥, 0💬

Reading a Text File to an Array in PHP
How To Read a Text File into an Array in PHP? 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, and returns the array to you. Here is a...
2016-12-04, 1534🔥, 0💬

Variables Are Passed by Values in PHP
How Variables Are Passed Through Arguments? in PHP? Like more of other programming languages, variables are passed through arguments by values, not by references. That means when a variable is passed as an argument, a copy of the value will be passed into the function. Modifying that copy inside the...
2016-12-24, 1532🔥, 0💬

Technical Specifications for File Upload in PHP
How To Get the Technical Specifications for File Upload in PHP? File upload technical specifications is provided in "Form-based File Upload in HTML - RFC 1867". You can get a copy from http://www.ietf.org/rfc/rfc186 7.txt.    ⇒ PHP Tutorials ⇐ Configuration Settings for File Upload in PHP ⇑ Upload...
2016-10-14, 1532🔥, 0💬

How Sessoion IDs Are Transferred in PHP
How Session IDs Are Transferred on Your Web Server in PHP? As you know there are two options the PHP engine can use to transfer session IDs to the client browsers. But how to do know which option is your PHP engine is using? The PHP sample script will help you to find out: &lt;?php session_start...
2016-10-25, 1530🔥, 0💬

Looping through Returning Rows from a Query in PHP
How To Query Tables and Loop through the Returning Rows in PHP? The best way to query tables and loop through the returning rows is to run the SELECT statement with the catch the mysql_query() function, catch the returning object as a result set, and loop through the result with the mysql_fetch_asso...
2016-10-19, 1530🔥, 0💬

Specifying Input Values for Checkboxes in PHP
How To Specify Input Values for Checkboxes in PHP? Checkboxes can be used in a form for two situations: As a single switch - One &lt;INPUT TYPE=CHECKBOX ...&gt; tag, with no input value specified. When submitted with button pushed down, you will receive a value of "on". When submitted with b...
2016-11-13, 1529🔥, 0💬

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