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

Returning a Value from a Function in PHP
How To Return a Value Back to the Function Caller? in PHP? You can return a value to the function caller by using the "return $value" statement. Execution control will be transferred to the caller immediately after the return statement. If there are other statements in the function after the return ...
2016-12-24, 298👍, 0💬

Splitting a String into an Array in PHP
How To Split a String into an Array of Substring in PHP? There are two functions you can use to split a string into an Array of Substring: explode(substring, string) - Splitting a string based on a substring. Faster than split(). split(pattern, string) - Splitting a string based on a regular express...
2016-12-28, 297👍, 0💬

Retrieving the Original Query String in PHP
How To Retrieve the Original Query String in PHP? If you have coded some values in the URL without using the standard form GET format, you need to retrieve those values in the original query string in $_SERVER['QUERY_STRING']. The script below is an enhanced version of processing_forms.php which pri...
2016-11-05, 296👍, 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: <?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, 296👍, 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 <INPUT TYPE=CHECKBOX ...> tag, with no input value specified. When submitted with button pushed down, you will receive a value of "on". When submitted with button no...
2016-11-13, 295👍, 0💬

What Is a Persistent Cookie in PHP
What Is a Persistent Cookie in PHP? 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 is closed, temporary cookies will be erased. Yo...
2016-11-04, 295👍, 0💬

HTML Table Row 'tr' Tag/Element
What Is a "tr" Tag/Element? A "tr" element is a special element that can only be used as a sub-element of a "table" element. A "tr" element defines a row in a table. Here are basic rules about "tr" elements: "tr" elements are special elements only valid inside "table" elements. "tr" elements can not...
2017-05-20, 294👍, 0💬

Reading the Entire File to a String in PHP
How To Read the Entire File into a Single String in PHP? If you have a file, and you want to read the entire file into a single string, you can use the file_get_contents() function. It opens the specified file, reads all characters in the file, and returns them in a single string. Here is a PHP scri...
2016-12-04, 294👍, 0💬

Attributes of an HTML 'img' Element
What Are the Attributes of an "img" Element? There are 4 commonly used attributes for an "img" element: "src" - Required attribute. Used to specify the URL of the image file. "alt" - Required attribute. Used to specify the name of the image. "width" - Optional attribute. Used to specify the width of...
2017-03-27, 293👍, 0💬

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(): <?p...
2017-01-11, 292👍, 0💬

Interview Questions - HTML Forms and Input Fields
Where to find Interview Questions on HTML Forms and Input Fields? Here are some interview questions on HTML Forms and Input Fields: What is a form? What elements can you use to submit a form? When a form is submitted, where the data is delivered to? What is a hidden input field? How to create a grou...
2017-02-28, 291👍, 0💬

Reading Directory Entries in PHP
How To Read a Directory One Entry at a Time in PHP? If you want to read a directory one entry at a time, you can use opendir() to open the specified directory to create a directory handle, then use readdir() to read the directory contents through the directory handle one entry at a time. readdir() r...
2016-11-20, 291👍, 0💬

Supporting Hidden Form Fields in PHP
How To Support Hidden Form Fields in PHP? Hidden fields are special fields in a form that are not shown on the Web page. But when the form is submitted, values specified in the hidden fields are also submitted to the Web server. A hidden field can be specified with the <INPUT TYPE=HIDDEN ...> ...
2016-11-08, 291👍, 0💬

Downloading and Installing PHP
Where to find tutorials in downloading and installing PHP binary version for Windows system. Here is a list of tutorials to answer many frequently asked questions compiled by FYIcenter.com team in downloading and installing PHP binary version for Windows system. Installing PHP for Windows Verifying ...
2016-10-13, 291👍, 0💬

Passing Variables by References in PHP
How To Pass Variables By References? in PHP? You can pass a variable by reference to a function by taking the reference of the original variable, and passing that reference as the calling argument. Here is a PHP script on how to use pass variables by references: <?php function swap($a, $b) { $t =...
2016-12-24, 290👍, 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, 290👍, 0💬

HTML 'img' Tag/Element
What Is an "img" Tag/Element? A "img" element is an inline element that you can use to define an inline image to be included in a XHTML document. Here are basic rules about an "img" element: "img" elements are inline elements. A "img" element must have empty content. A "img" element requires an attr...
2017-03-27, 289👍, 0💬

Protecting Special Characters in Query String in PHP
How To Protect Special Characters in Query String in PHP? If you want to include special characters like spaces in the query string, you need to protect them by applying the urlencode() translation function. The script below shows how to use urlencode(): <?php print("<html>"); print("<p&...
2016-11-05, 289👍, 0💬

Interview Questions - HTML Hyper Links and Images
Where to find Interview Questions on HTML Hyper Links and Images? Here are some interview questions on HTML Hyper Links and Images: What is a hyper link? What is a URL? How to included an image in the middle of a sentence? How to place an image to the right side of a paragraph? What is an image map?...
2017-02-28, 288👍, 0💬

Passing Arrays by Values to Functions in PHP
How Arrays Are Passed Through Arguments? in PHP? 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 copy inside the function will not impact...
2016-12-18, 288👍, 0💬

Function with Undefined Number of Arguments in PHP
How To Define a Function with Any Number of Arguments? in PHP? If you want to define a function with any number of arguments, you need to: Declare the function with no argument. Call func_num_args() in the function to get the number of the arguments. Call func_get_args() in the function to get all t...
2016-12-04, 288👍, 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 <FORM> tag with some input tags. The <F...
2016-11-17, 288👍, 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, 288👍, 0💬

Uploading Files to Web Servers in PHP
Where to find tutorials on how to upload files to Web servers in PHP? A collection of tutorials to answer many frequently asked questions on how to upload files to Web servers in PHP. Clear explanations and tutorial exercises are provided on creating file upload HTML tags, setting encoding type on H...
2016-10-17, 288👍, 0💬

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