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

Creating an Array with a Sequence in PHP
How To Create an Array with a Sequence of Integers or Characters in PHP? The quickest way to create an array with a sequence of integers or characters is to use the range() function. It returns an array with values starting with the first integer or character, and ending with the second integer or c...
2017-01-05, 441👍, 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, 440👍, 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, 434👍, 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, 417👍, 0💬

HTML 'table' Element Attributes
What Are the Attributes of a "table" Element? A "table" element may have the following commonly used attributes: "summary" - Specifies a text string as the summary of the table. "width" - Specifies the width of the table. "border" - Specifies the border width. "frame" - Specifies how the outer borde...
2017-05-13, 416👍, 0💬

HTML 'code' Tag/Element
What Is an HTML "code" Tag/Element? An "code" element is an inline element that you can use to specify text to be treated as computer code. Here are basic rules about "code" elements: "code" elements are inline elements. "code" elements can not be used at block level. Contents of "code" elements wil...
2017-04-28, 416👍, 0💬

'width' for HTML Table Widths
How To Control Table Widths? Usually, browsers will calculate the table width based on the content widths of table cells. If you want to control the width of a table, you need to use the "width" attribute, which allows you to set the table width in pixels or percentages of the parent element width. ...
2017-05-05, 415👍, 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, 415👍, 0💬

HTML Tables and Table Cells
Where to find tutorials of introduction to HTML Tables and Table Cells? Here is a list of tutorials to answer many frequently asked questions compiled by FYIcenter.com team in introduction to HTML Tables and Table Cells. Clear answers are provided with tutorial exercises on table elements like: tabl...
2017-05-20, 409👍, 0💬

Appending Data to the End of a File in PHP
How To Append New Data to the End of a File in PHP? If you have an existing file, and want to write more data to the end of the file, you can use the fopen($fileName, "a") function. It opens the specified file, moves the file pointer to the end of the file, and returns a file handle. The second argu...
2016-12-02, 407👍, 0💬

HTML 'del' and 'ins' Tags/Elements
What Are HTML "del" and "ins" Tags/Elements? "del" and "ins" elements are inline elements that you can use to specify text to be treated as deleted text and inserted text respectively. Here are basic rules about "del" and "ins" elements: "del" and "ins" elements are inline elements. "del" and "ins" ...
2017-04-28, 406👍, 0💬

HTML Un-ordered List 'ul' Tag/Element
What Is a "ul" Tag/Element? A "ul" element is block level element that can be used to define an un-ordered list, where items are displayed with leading bullets. Here are basic rules about "ul" elements: "ul" elements are block level elements. "ul" elements can not have text contents. An "ul" element...
2017-05-29, 405👍, 0💬

Passing an Argument to a Function in PHP
How To Pass an Argument to a Function? in PHP? To pass an argument to a function, you need to: Add an argument definition in the function definition. Add a value as an argument when invoking the function. Here is a PHP script on how to use arguments in a function(): &lt;?php function f2c($f) { r...
2016-12-24, 402👍, 0💬

HTML Description 'meta' Tag/Element
What Is the Description "meta" Tag/Element? The description "meta" element is a special meta element that provides a short descript about the HTML document. The description "meta" element must include the "name" attribute as, name="description". Here is an example: &lt;meta name="description" co...
2017-06-28, 401👍, 0💬

HTML Nested List Elements
Can List Elements Be Nested? Yes. You can nest list element within each other because: List items can have block elements as contents. List elements are block elements. List items can have list elements as contents resulting nested list elements. Below is a good tutorial example of using nested list...
2017-05-29, 401👍, 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, 400👍, 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, 400👍, 0💬

HTML Ordered List Item Markers
How To Use Different Markers on Ordered List Items? By default, browsers will use decimal numbers as the item markers for ordered lists. If you want to change them to something else, like alphabetical letters, you need to use CSS properties. Here is a tutorial sample showing you how to set item mark...
2017-05-29, 399👍, 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, 399👍, 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, 399👍, 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, 399👍, 0💬

Missing XHTML 'title' Element
What Happens If the XHTML "title" Element is Missing? XHTML 1.0 requires you write the title element inside the head element. If you forget to include the title element, the XHTML validator will return an error to you. Here is how you can test this yourself. Go the W3 XHTML validator Web site: http:...
2017-06-28, 397👍, 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, 396👍, 0💬

Index of Array Values in PHP
How Values in Arrays Are Indexed in PHP? Values in an array are all indexed their corresponding keys. Because we can use either an integer or a string as a key in an array, we can divide arrays into 3 categories: Numerical Array - All keys are sequential integers. Associative Array - All keys are st...
2017-02-03, 395👍, 0💬

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