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

PHP Tutorials
Where to find tutorials on PHP language? I want to know how to learn PHP. Here is a large collection of tutorials to answer many frequently asked questions compiled by FYIcenter.com team about PHP language: Downloading and Installing PHP Installing PHP for Windows Verifying PHP Installation PHP Conf...
2022-09-24, 50962👍, 1💬

💬 2022-09-24 Franklin: Easy to follow. Thanks

Reading Data from Keyboard in PHP
How To Read Data from Keyboard (Standard Input) in PHP? If you want to read data from the standard input, usually the keyboard, you can use the fopen("php://stdin") function. It creates a special file handle linking to the standard input, and returns the file handle. Once the standard input is opene...
2023-03-05, 6506👍, 2💬

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

Reading a File in Binary Mode in PHP
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an executable program or picture file, you need to read the file in binary mode to ensure that none of the data gets modified during the reading process. You need to: Open the file with fopen($fileName, "rb")....
2016-11-27, 5143👍, 0💬

Passing Arrays by References to Functions in PHP
How To Pass Arrays By References? in PHP? Like normal variables, you can pass an array by reference into a function by taking a reference of the original array, and passing the reference to the function. Here is a PHP script on how to pass array as reference: <?php function shrink($array) { a...
2016-12-18, 4393👍, 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($arr...
2016-12-28, 3525👍, 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, 3295👍, 0💬

Looping through an Array without "foreach" in PHP
How To Loop through an Array without Using "foreach" in PHP? PHP offers the following functions to allow you loop through an array without using the "foreach" statement: reset($array) - Moves the array internal pointer to the first value of the array and returns that value. end($array) - Moves the a...
2017-01-05, 3046👍, 0💬

Removing Slashes on Submitted Input Values in PHP
How To Remove Slashes on Submitted Input Values in PHP? By default, when input values are submitted to the PHP engine, it will add slashes to protect single quotes and double quotes. You should remove those slashes to get the original values by applying the stripslashes() function. Note that PHP eng...
2022-12-14, 2949👍, 1💬

💬 2022-12-14 /nme: /data

What Is session_register() in PHP
What Is session_register() in PHP? session_register() is old function that registers global variables into the current session. You should stop using session_register() and use array $_SESSION to save values into the current session now.     ⇒ Working with MySQL Database in PHP ⇐ Closing a Session ...
2016-10-22, 2922👍, 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, 2878👍, 0💬

Submitting Values without Using a Form in PHP
How To Submit Values without Using a Form in PHP? If you know the values you want to submit, you can code the values in a hyper link at the end of the URL. The additional values provided at the end of a URL is called query string. There are two suggestions on how to use query strings to submit value...
2016-11-08, 2711👍, 0💬

Moving Uploaded Files to Permanent Directory in PHP
How To Move Uploaded Files To Permanent Directory in PHP? PHP stores uploaded files in a temporary directory with temporary file names. You must move uploaded files to a permanent directory, if you want to keep them permanently. PHP offers the move_uploaded_file() to help you moving uploaded files. ...
2016-10-14, 2645👍, 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, 2622👍, 0💬

"new line" Character in Single-Quoted Strings in PHP
Can You Specify the "new line" Character in Single-Quoted Strings? You can not specify the "new line" character in a single-quoted string. If you don't believe, try this script: <?php echo '\n will not work in single quoted strings.'; ?> This script will print: \n will not work in sing...
2016-10-13, 2510👍, 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, 2352👍, 0💬

Creating Your Own Functions in PHP
Where to find tutorials on how to create Your Own Functions in PHP? A collection of tutorials to answer many frequently asked questions on Creating Your Own Functions in PHP. Topics included in this collection are: Defining a User Function in PHP Invoking a User Function in PHP Returning a Value fro...
2016-12-28, 2319👍, 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, 2272👍, 0💬

Reading and Writing Files in PHP
Where to find tutorials on how to Read and Write Files in PHP? A collection of tutorials to answer many frequently asked questions how to Read and Write Files in PHP. Topics included in this collection are: Reading a Text File to an Array in PHP Reading the Entire File to a String in PHP Opening a f...
2023-03-01, 2249👍, 1💬

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>"); p...
2022-09-09, 2212👍, 1💬

Quoting Date and Time Values in PHP
How To Quote Date and Time Values in SQL Statements in PHP? If you want to provide date and time values in a SQL statement, you should write them in the format of "yyyy-mm-dd hh:mm:ss", and quoted with single quotes ('). The tutorial exercise below shows you two INSERT statements. The first one uses...
2016-10-19, 2175👍, 0💬

Working with MySQL Database in PHP
Where to find tutorials on how to work with MySQL Database in PHP? A collection of tutorials to answer many frequently asked questions on how to Work with MySQL Database in PHP. Clear explanations and tutorial exercises are provided on connecting and selecting MySQL database, creating and dropping t...
2016-10-22, 2163👍, 0💬

Testing the strpos() Return Value in PHP
What Is the Best Way to Test the strpos() Return Value? Because strpos() could two types of values, Integer and Boolean, you need to be careful about testing the return value. The best way is to use the "Identical(===)" operator. Do not use the "Equal(==)" operator, because it does not differentiate...
2016-10-13, 2144👍, 0💬

Comparing Two Strings with strcmp() in PHP
How To Compare Two Strings with strcmp()? PHP supports 3 string comparison operators, <, ==, and >, that generates Boolean values. But if you want to get an integer result by comparing two strings, you can the strcmp() function, which compares two strings based on ASCII values of their...
2016-10-13, 2111👍, 0💬

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