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

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, 321👍, 0💬

Working with Directoris and Files in PHP
Where to find tutorials on how to Work with Directories and Files in PHP? A collection of tutorials to answer many frequently asked questions on how to Work with Directories and Files in PHP. Topics included in this collection are: Creating a Directory in PHP Removing an Empty Directory in PHP Remov...
2016-11-24, 321👍, 0💬

'frame' - Controlling HTML Table Borders
How To Turn On Some Parts of Table Outer Borders? If you don't want to turn all 4 edges of outer borders in a table, you need to use the "frame" attribute, which offer the following options: <table border="1" frame="border"> - Turns on all 4 edges. <table border="1" frame="box"> - Turns ...
2017-05-13, 318👍, 0💬

Order of Array Values in PHP
How the Values Are Ordered in an Array in PHP? PHP says that an array is an ordered map. But how the values are ordered in an array? The answer is simple. Values are stored in the same order as they are inserted like a queue. If you want to reorder them differently, you need to use a sort function. ...
2017-01-29, 318👍, 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, 317👍, 0💬

HTML Tutorials
Where to find tutorials on HTML language? I want to know how to learn HTML. Here is a large collection of tutorials to answer many frequently asked questions compiled by FYIcenter.com team about HTML language: Introduction of HTML What Is HTML? HTML Versions and Variations HTML Document Example XHTM...
2017-02-20, 315👍, 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: <?php $array = array("Hello!", "Hi!", "Allo!", "Hallo!", "C...
2017-01-11, 315👍, 0💬

Accessing Global Variables inside a Function in PHP
How To Access a Global Variable inside a Function? in PHP? By default, global variables are not accessible inside a function. However, you can make them accessible by declare them as "global" inside a function. Here is a PHP script on declaring "global" variables: <?php ?> $intRate = 5.5; func...
2016-12-08, 315👍, 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: <?php function average($array) { $sum = array_sum($array); $count = count($array); return $s...
2016-12-18, 314👍, 0💬

Function Returns Data by Value in PHP
How Values Are Returned from Functions? in PHP? If a value is returned from a function, it is returned by value, not by reference. That means that a copy of the value is return. Here is a PHP script on how values are returned from a function: <?php $favor = "vbulletin"; function getFavor() { glob...
2016-12-08, 314👍, 0💬

Opening Standard Output as a File Handle in PHP
How To Open Standard Output as a File Handle in PHP? 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. Once the standard output is opened to ...
2016-11-24, 313👍, 0💬

Getting Minimum/Maximum Value of an Array in PHP
How To Get the Minimum or Maximum Value of an Array in PHP? If you want to get the minimum or maximum value of an array, you can use the min() or max() function. Here is a PHP script on how to use min() and max(): <?php $array = array(5, 7, 6, 2, 1, 3, 4, 2); print("Minimum number: ".min($array)....
2016-12-28, 311👍, 0💬

Verifying If a Key Exists in an Array in PHP
How Do You Know If a Key Is Defined in an Array in PHP? There are two functions can be used to test if a key is defined in an array or not: array_key_exists($key, $array) - Returns true if the $key is defined in $array. isset($array[$key]) - Returns true if the $key is defined in $array. Here is a P...
2017-01-29, 309👍, 0💬

Defining a User Function in PHP
How To Define a User Function? in PHP? You can define a user function anywhere in a PHP script using the function statement like this: "function name() {...}". Here is a PHP script example on how to define a user function: <?php function msg() { print("Hello world!\n"); } msg(); ?> This script...
2016-12-28, 309👍, 0💬

Multiple Paragraphs in an HTML List Item
Can Multiple Paragraphs Be Included in a List Item? Yes. You can include multiple paragraphs in a single list item, because "li" is a flow type element, which can have block elements and inline elements. The tutorial example below shows you how a list item can have two paragraphs: <?xml version="...
2017-05-29, 308👍, 0💬

Looping through an Array in PHP
How to Loop through an Array in PHP? The best way to loop through an array is to use the "foreach" statement. There are two forms of "foreach" statements: foreach ($array as $value) {} - This gives you only one temporary variable to hold the current value in the array. foreach ($array as $key=>$v...
2017-02-03, 308👍, 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, 308👍, 0💬

$_GET, $_POST and $_REQUEST in PHP
Where Is the Submitted Form Data Stored in PHP? When a user submit a form on your Web server, user entered data will be transferred to the PHP engine, which will make the submitted data available to your PHP script for processing in pre-defined arrays: $_GET - An associate array that store form data...
2016-11-15, 308👍, 0💬

HTML 'form' Element Attributes
What Are the Attributes of a "form" Element? There are 3 commonly used attributes for a "form" element: "action" - Required attribute. Used to specify the URL of the form processing program. "method" - Optional attribute. Used to specify the form submission method: "get" or "post". method="get" is t...
2017-04-19, 306👍, 0💬

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

Invoking a User Function in PHP
How To Invoke a User Function? in PHP? You can invoke a function by entering the function name followed by a pair of parentheses. If needed, function arguments can be specified as a list of expressions enclosed in parentheses. Here is a PHP script example on how to invoke a user function: <?php f...
2016-12-28, 306👍, 0💬

Supporting Multiple Submit Buttons in PHP
How To Support Multiple Submit Buttons in PHP? Sometimes, you may need to give visitors multiple submit buttons on a single form to allow them to submit the form for different purposes. For example, when you show your customer a purchase order in a Web form, you may give your customer 3 submit butto...
2016-11-08, 304👍, 0💬

HTML Forms and Input Fields
Where to find tutorials of introduction to HTML Forms and Input Fields? Here is a list of tutorials to answer many frequently asked questions compiled by FYIcenter.com team in introduction to HTML Forms and Input Fields. Clear answers are provided with tutorial exercises on forms and input fields: f...
2017-04-22, 301👍, 0💬

Joining Array Values into a Single String in PHP
How To Join Multiple Strings Stored in an Array into a Single String in PHP? 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(): <?php $date = array('01', ...
2017-01-05, 300👍, 0💬

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