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

Domain and Path Attributes for Cookies in PHP
What Are Domain and Path Attributes for Cookies in PHP? Cookies can also be defined with two other attributes: Domain - A cookie attribute that defines the domain name of Web servers where this cookie is valid. Web browsers holding this cookie should not sent it back to any Web server outside the sp...
2016-11-03, 1899🔥, 0💬

Returning a Reference from a Function in PHP
How To Return a Reference from a Function? in PHP? To return a reference from a function, you need to: Add the reference operator "&amp;" when defining the function. Add the reference operator "&amp;" when invoking the function. Here is a PHP script on how to return a reference from a functi...
2016-12-08, 1896🔥, 0💬

Specifying Domain and Path for a Cookie in PHP
How To Specify Domain and Path for a Cookie in PHP? 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 temporary and persistent cookies: &lt;?php se...
2016-11-03, 1895🔥, 0💬

Inserting Rows Based on SELECT Statement in PHP
How To Insert Rows Based on SELECT Statements in PHP? If want to insert rows into a table based on data rows from other tables, you can use a sub-query inside the INSERT statement as shown in the following script example: &lt;?php include "mysql_connection.php"; $sql = "INSERT INTO fyi_links" . ...
2016-10-20, 1882🔥, 0💬

Joining Multiple Strings in PHP
How To Join Multiple Strings into a Single String? If you multiple strings stored in an array, you can join them together into a single string with a given delimiter by using the implode() function. Here is a PHP script on how to use implode(): &lt;?php $date = array('01', '01', '2006'); $keys =...
2016-10-13, 1863🔥, 0💬

Cookies Encoded during Transportation in PHP
How Are Cookies Encoded During Transportation in PHP? When cookies are transported from servers to browsers and from browsers back to servers, Cookies values are always encoded using the URL encoding standard to ensure that they are transported accurately. But you don't need to worry about the encod...
2016-10-29, 1856🔥, 0💬

Processing Web Forms in PHP
Where to find tutorials on how to process Web Forms in PHP? A collection of tutorials to answer many frequently asked questions on how to process Web Forms in PHP. Clear explanations and tutorial exercises are provided on generating and processing Web forms, getting values out of $_REQUEST, processi...
2016-11-17, 1853🔥, 0💬

Counting the Number of Values in an Array in PHP
How To Get the Total Number of Values in an Array in PHP? 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)."\n"); $array = array(); print_r("Size 2: ".c...
2017-01-29, 1844🔥, 0💬

Writing a String to a File without a File Handle in PHP
How To Write a String to a File without a File Handle in PHP? If you have a string, 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 the specified string, closes the file, and returns the numb...
2016-11-27, 1842🔥, 0💬

Randomly Retrieving Array Values in PHP
How To Randomly Retrieve a Value from an Array in PHP? If you have a list of favorite greeting messages, and want to randomly select one of them to be used in an email, you can use the array_rand() function. Here is a PHP example script: &lt;?php $array = array("Hello!", "Hi!", "Allo!", "Hallo!"...
2017-01-11, 1826🔥, 0💬

Sorting an Array by Values in PHP
How To Sort an Array by Values in PHP? Sorting an array by values is doable by using the sort() function. It will re-order all pairs of keys and values based on the alphanumeric order of the values. Then it will replace all keys with integer keys sequentially starting with 0. So using sort() on arra...
2017-01-21, 1825🔥, 0💬

Cookie Management on Firefox in PHP
How Does Firefox Manage Cookies in PHP? Firefox browser allows you to delete old cookies, and gives you options to keep persistent cookies in cookie files until they reach their expiration time. The following tutorial shows you how to manage cookies in Firefox: Run Firefox Go to Tools/Options Click ...
2016-10-30, 1822🔥, 0💬

Understanding PHP String Literals and Operations
Where to find tutorials for PHP String Literals and Operations? A collection of tutorials on PHP string literals, operations and conversion. Clear explanations and tutorial exercises are provided on single-quoted strings, double-quoted strings, string elements, concatenation, converting values to st...
2016-10-13, 1819🔥, 0💬

Using MySQL Command Line Interface in PHP
How To Use MySQL Command Line Interface in PHP? MySQL server comes with a command line interface, which will allow you to operate with the server with SQL statements and other commands. To start the command line interface, you can run the \mysql\bin\mysql program. The tutorial exercise below shows y...
2016-10-22, 1814🔥, 0💬

PHP Built-in Functions for Strings
Where to find tutorials and answers to frequently asked questions for PHP Built-in Functions for Strings? A collection of frequently asked questions on manipulating strings in PHP. Clear answers are provided with tutorial exercises on string functions including strlen, trim, substr, chop, strpos, st...
2016-10-13, 1786🔥, 0💬

Creating a Web Form in PHP
How To Create a Web Form in PHP? If you take input data from visitors on your Web site, you can create a Web form with input fields to allow visitors to fill in data and submit the data to your server for processing. A Web form can be created with the &lt;FORM&gt; tag with some input tags. T...
2016-11-17, 1783🔥, 0💬

Retrieving Submitted Form Data in PHP
How To Retrieve the Submitted Form Data in PHP? The best way to retrieve the form data submitted by your visitor is to use the $_REQUEST array. The keys in this array will be the field names defined in form. The values in this array will be the values entered by your visitor in the input fields. The...
2016-11-15, 1783🔥, 0💬

Passing Arrays to Function in PHP
Can You Pass an Array into a Function? in PHP? You can pass an array into a function in the same as a normal variable. No special syntax needed. Here is a PHP script on how to pass an array to a function: &lt;?php function average($array) { $sum = array_sum($array); $count = count($array); retur...
2023-04-06, 1782🔥, 1💬

💬 2023-04-06 Durga: Good

Merging Two Arrays into a Single Array in PHP
How To Merge Values of Two Arrays into a Single Array in PHP? You can use the array_merge() function to merge two arrays into a single array. array_merge() appends all pairs of keys and values of the second array to the end of the first array. Here is a PHP script on how to use array_merge(): &l...
2017-01-11, 1782🔥, 0💬

Finding a Given Value in an Array in PHP
How To Find a Specific Value in an Array in PHP? There are two functions can be used to test if a value is defined in an array or not: array_search($value, $array) - Returns the first key of the matching value in the array, if found. Otherwise, it returns false. in_array($value, $array) - Returns tr...
2017-01-21, 1776🔥, 0💬

Putting Directory Entries into an Array in PHP
How To Dump the Contents of a Directory into an Array in PHP? If you want to get the contents of a directory into an array, you can use the scandir() function. It gets a list of all the files and sub directories of the specified directory and returns the list as an array. The returning list also inc...
2016-11-20, 1768🔥, 0💬

Replacing a Substring in PHP
How To Replace a Substring in a Given String? If you know the position of a substring in a given string, you can replace that substring by another string by using the substr_replace() function. Here is a PHP script on how to use substr_replace(): &lt;?php $string = "Warning: System will shutdown...
2016-10-13, 1766🔥, 0💬

Sorting an Array by Keys in PHP
How To Sort an Array by Keys in PHP? Sorting an array by keys can be done by using the ksort() function. It will re-order all pairs of keys and values based on the alphanumeric order of the keys. Here is a PHP script on how to use ksort(): &lt;?php $mixed = array(); $mixed["Zero"] = "PHP"; $mixe...
2017-01-21, 1762🔥, 0💬

Reformatting a Paragraph of Text in PHP
How To Reformat a Paragraph of Text? You can wordwrap() reformat a paragraph of text by wrapping lines with a fixed length. Here is a PHP script on how to use wordwrap(): &lt;?php $string = "TRADING ON MARGIN POSES ADDITIONAL RISKS AND IS NOT SUITABLE FOR ALL INVESTORS. A COMPLETE LIST OF THE RI...
2024-02-27, 1749🔥, 5💬

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