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

Creating a Database Table to Store Files in PHP
How To Create a Table To Store Files in PHP? If you using MySQL database and want to store files in database, you need to create BLOB columns, which can holds up to 65,535 characters. Here is a sample script that creates a table with a BLOB column to be used to store uploaded files: &lt;?php $co...
2016-10-14, 796👍, 0💬

HTML 'em' Tag/Element
What Is an HTML "em" Tag/Element? An "em" element is an inline element that you can use to specify text with a normal emphasis. Here are basic rules about "em" elements: "em" elements are inline elements. "em" elements can not be used at block level. Contents of "em" elements will be displayed in it...
2017-04-28, 794👍, 0💬

Supporting a Multiple-Page Form in PHP
How To Support Multiple-Page Forms in PHP? If you have a long form with a lots of fields, you may want to divide the fields into multiple groups and present multiple pages with one group of fields on one page. This makes the a long form more user-friendly. However, this requires you to write good sc...
2016-11-05, 790👍, 0💬

Generating and Processing Form with the Same Script in PHP
How To Generate and Process a Form with the Same Script in PHP? In previous exercises, a Web form is generated by one script, and processed by another script. But you could write a single script to do both. You just need to remember to: Use same script name as the form generation script in the "acti...
2016-11-08, 789👍, 0💬

PHP Built-in Functions for Arrays
Where to find tutorials on how to use PHP built-in functions to manage arrays? A collection of tutorials to answer many frequently asked questions on how to PHP functions to manage arrays. Clear answers are provided with tutorial exercises on searching keys and values, sorting arrays, merging two ar...
2017-01-29, 788👍, 0💬

Specifying Argument Default Values in PHP
How To Specify Argument Default Values? in PHP? 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 this "function name($arg=expression){}. Her...
2016-12-04, 784👍, 0💬

Adding Values to an Array without Keys in PHP
Can You Add Values to an Array without Keys in PHP? Can You Add Values to an Array with a Key? The answer is yes and no. The answer is yes, because you can add values without specifying any keys. The answer is no, because PHP will add a default integer key for you if you are not specifying a key. PH...
2017-02-03, 769👍, 0💬

'align' - Horizontal Alignment HTML Tables
How To Control Horizontal Alignment in Table Cells? By default, text in all table cells are aligned to the left horizontally. If you want to control horizontal alignment yourself, you need to use the "align" attribute in a "tr" element or a "td" element: &lt;tr align="left|center|right"& gt;...
2017-05-05, 765👍, 0💬

Using an Array as a Stack in PHP
How To Use an Array as a Stack in PHP? A stack is a simple data structure that manages data elements following the first-in-last-out rule. You use the following two functions together to use an array as a stack: array_push($array, $value) - Pushes a new value to the end of an array. The value will b...
2017-01-11, 751👍, 0💬

Running a PHP Script
How To Run a PHP Script? A standard alone PHP script can be executed directly with the PHP Command Line Interface (CLI). Write the following script in a file called hello.php: &lt;?php echo "Hello world!"; ?&gt; This script can be executed by CLI interface like this: \php\php hello.php You s...
2016-10-13, 749👍, 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, 748👍, 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, 737👍, 0💬

Issue with "while ($c=fgetc($f))" Loop in PHP
What's Wrong with "while ($c=fgetc($f)) {}" in PHP? If you are using "while ($c=fgetc($f)) {}" to loop through each character in a file, the loop may end in the middle of the file when there is a "0" character, because PHP treats "0" as Boolean false. To properly loop to the end of the file, you sho...
2016-11-27, 732👍, 0💬

Retrieving All Values from an Array in PHP
How To Get All the Values Out of an Array in PHP? Function array_values() returns a new array that contains all the values of a given array. Here is a PHP script on how to use array_values(): &lt;?php $mixed = array(); $mixed["Zero"] = "PHP"; $mixed[1] = "Perl"; $mixed["Two"] = "Java"; $mixed["3...
2017-01-21, 728👍, 0💬

Copying an Array in PHP
Can You Copy an Array in PHP? You can create a new array by copying an existing array using the assignment statement. Note that the new array is not a reference to the old array. If you want a reference variable pointing to the old array, you can use the reference operator "&amp;". Here is a PHP...
2017-02-03, 720👍, 0💬

Writing a String to a File with a File Handle in PHP
How To Write a String to a File with a File Handle in PHP? If you have a file handle linked to a file opened for writing, and you want to write a string to the file, you can use the fwrite() function. It will write the string to the file where the file pointer is located, and moves the file pointer ...
2016-11-27, 711👍, 0💬

'valign' - Vertical Alignment in HTML Table
How To Control Vertical Alignment? By default, text in all table cells are aligned to the top vertically. If you want to control vertical alignment yourself, you need to use the "valign" attribute in a "tr" element or a "td" element: &lt;tr valign="top|middle|bottom"& ;gt;- Set vertical align...
2017-05-05, 701👍, 0💬

Using an Array as a Queue in PHP
How To Use an Array as a Queue in PHP? A queue is a simple data structure that manages data elements following the first-in-first-out rule. You use the following two functions together to use an array as a queue: array_push($array, $value) - Pushes a new value to the end of an array. The value will ...
2017-01-11, 701👍, 0💬

'cellpadding' - Padding Spaces in HTML Table Cell
How To Control Padding Spaces within a Table Cell? Cell padding spaces are spaces between cell inner borders and cell content. By default, browsers give cell padding spaces of 1 pixel. If you want to control cell padding spaces within a table cell, you need to use the "cellpadding" attribute, which ...
2017-05-13, 699👍, 0💬

Padding an Array with a Given Value in PHP
How To Pad an Array with the Same Value Multiple Times in PHP? If you want to add the same value multiple times to the end or beginning of an array, you can use the array_pad($array, $new_size, $value) function. If the second argument, $new_size, is positive, it will pad to the end of the array. If ...
2017-01-05, 695👍, 0💬

FYIcenter JSON Validator and Formatter
FYIcenter JSON Validator and Formatter is an online tool that checks for syntax errors of JSON text string and converts it to a pretty format.
2017-11-25, 681👍, 2💬

💬 2017-11-25 Eric: Agree.

💬 2017-08-13 Neil: Not too bad!

Creating HTML Table Borders
How To Create Table Borders? There are two sets of borders within a table: Outer Borders - Borders that around the outer edges of the table. Inner Borders - Borders between table cells. If you want to create table outer borders and inner borders, you can use the "border" attribute, which offers two ...
2017-05-13, 661👍, 0💬

HTML Definition List 'dl' Tag/Element
What Is a "dl" Tag/Element? A "dl" element is block level element that can be used to define a definition list, where items are displayed with leading terms. Here are basic rules about "dl" elements: "dl" elements are block level elements. "dl" elements can not have text contents. An "dl" element mu...
2017-05-29, 658👍, 0💬

Copying Array Values to a List of Variables in PHP
How To Copy Array Values to a List of Variables in PHP? If you want copy all values of an array to a list of variable, you can use the list() construct on the left side of an assignment operator. list() will only take values with integer keys starting from 0. Here is a PHP script on how to use list(...
2017-01-29, 658👍, 0💬

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