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

Reformatting a Paragraph of Text in PHP
How To Reformat a Paragraph of Text? You can wordwrap() reformat a paragraph of text by wrapping lines with a fixed length. Here is a PHP script on how to use wordwrap(): &lt;?php $string = "TRADING ON MARGIN POSES ADDITIONAL RISKS AND IS NOT SUITABLE FOR ALL INVESTORS. A COMPLETE LIST OF THE RI...
2024-02-27, 1733🔥, 5💬

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, 1732🔥, 0💬

Understanding and Managing Cookies in PHP
Where to find tutorials on how to manage Cookies in PHP? A collection of tutorials to answer many frequently asked questions how to manage Cookies in PHP. Clear explanations and tutorial exercises are provided on setting and receiving cookies, creating and removing persistent cookies, specifying dom...
2016-11-05, 1728🔥, 0💬

Number of Rows Affected by a SQL Statement in PHP
How To Get the Number of Rows Selected or Affected by a SQL Statement in PHP? There are two functions you can use the get the number of rows selected or affected by a SQL statement: mysql_num_rows($rs) - Returns the number of rows selected in a result set object returned from SELECT statement. mysql...
2016-10-20, 1726🔥, 0💬

PHP Configuration Setting File
Where Are PHP Configuration Settings Stored? PHP stores configuration settings in a file called php.ini in PHP home directory. You can open it with any text editor to your settings.     ⇒ Running a PHP Script ⇐ Verifying PHP Installation ⇑ Downloading and Installing PHP ⇑⇑ PHP Tutorials
2016-10-13, 1716🔥, 0💬

Verifying PHP Installation
How To Verify Your PHP Installation? PHP provides two execution interfaces: Command Line Interface (CLI) and Common Gateway Interface (CGI). If PHP is installed in the \php directory on your system, you can try this to check your installation: Run "\php\php -v" command to check the Command Line Inte...
2016-10-13, 1712🔥, 0💬

Working with Directories 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, 1701🔥, 0💬

Finding a Substring in PHP
How to Find a Substring from a Given String? To find a substring in a given string, you can use the strpos() function. If you call strpos($haystack, $needle), it will try to find the position of the first occurrence of the $needle string in the $haystack string. If found, it will return a non-negati...
2016-10-13, 1699🔥, 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, 1693🔥, 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: &lt;?php function msg() { print("Hello world!\n"); } msg(); ?&gt; Thi...
2016-12-28, 1689🔥, 0💬

What Is a Session ID in PHP
What Is a Session ID in PHP? A session ID is an identification string of a session. Since there might be multiple visitors coming to your Web site at the same time, the PHP engine needs to maintain multiple sessions concurrently. Session IDs are created and maintained by the PHP engine to identify s...
2016-10-26, 1684🔥, 0💬

Understanding PHP Arrays and Their Basic Operations
Where to find tutorials in Understanding PHP Arrays and Their Basic Operations? A collection of tutorials to answer many frequently asked questions on basic understanding of PHP arrays. Clear answers are provided with tutorial exercises on declaring and creating arrays, assigning and retrieving arra...
2016-10-15, 1670🔥, 0💬

Processing Uploaded Files in PHP
How To Process Uploaded Files in PHP? How to process the uploaded files? The answer is really depending on your application. For example: You can attached the outgoing emails, if the uploaded files are email attachments. You can move them to user's Web page directory, if the uploaded files are user'...
2016-10-17, 1667🔥, 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(): &lt;?php $date = array('0...
2017-01-05, 1660🔥, 0💬

Viewing Cookie Header Lines in PHP
How To View Cookie Header Lines in PHP? If you are interested to see the cookie header lines, or you are having trouble with your cookies and need to see the cookies to help debugging, you can run your script with PHP CGI interface in a command line window. The following tutorial exercise shows you ...
2016-11-02, 1660🔥, 0💬

Escape Sequences in Double-Quoted Strings in PHP
How Many Escape Sequences Are Recognized in Double-Quoted Strings? There are 12 escape sequences you can use in double-quoted strings: \\ - Represents the back slash character. \" - Represents the double quote character. \$ - Represents the dollar sign. \n - Represents the new line character (ASCII ...
2016-10-13, 1657🔥, 0💬

Reading One Character from a File in PHP
How To Read One Character from a File in PHP? If you have a text file, and you want to read the file one character at a time, you can use the fgetc() function. It reads the current character, moves the file pointer to the next character, and returns the character as a string. If end of the file is r...
2016-12-02, 1654🔥, 0💬

Testing If a Variable Is an Array in PHP
How To Test If a Variable Is an Array in PHP? Testing if a variable is an array is easy. Just use the is_array() function. Here is a PHP script on how to use is_array(): &lt;?php $var = array(0,0,7); print("Test 1: ". is_array($var)."\n"); $var = array(); print("Test 2: ". is_array($var)."\n"); ...
2016-10-15, 1651🔥, 0💬

Form Input HTML Tags in PHP
What Are Form Input HTML Tags in PHP? HTML tags that can be used in a form to collect input data are: &lt;SUBMIT ...&gt; - Displayed as a button allow users to submit the form. &lt;INPUT TYPE=TEXT ...&gt; - Displayed as an input field to take an input string. &lt;INPUT TYPE=RADIO...
2016-11-17, 1647🔥, 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: &lt;?php $favor = "vbulletin"; function getFavor() { ...
2016-12-08, 1644🔥, 0💬

Replacing Characters in a String in PHP
How To Replace a Group of Characters by Another Group? While processing a string, you may want to replace a group of special characters with some other characters. For example, if you don't want to show user's email addresses in the original format to stop email spammer collecting real email address...
2016-10-13, 1642🔥, 0💬

Local Variables in a Function in PHP
What Is the Scope of a Variable Defined in a Function? in PHP? The scope of a local variable defined in a function is limited with that function. Once the function is ended, its local variables are also removed. So you can not access any local variable outside its defining function. Here is a PHP sc...
2016-12-08, 1636🔥, 0💬

Converting Numbers to Strings in PHP
How To Convert Numbers to Strings? In a string context, PHP will automatically convert any numeric value to a string. Here is a PHP script examples: &lt;?php print(-1.3e3); print("\n"); print(strlen(-1.3e3)); print("\n"); print("Price = $" . 99.99 . "\n"); print(1 . " + " . 2 . " = " . 1+2 . "\n...
2016-10-13, 1630🔥, 0💬

Special Characters in Double-Quoted Strings in PHP
What Are the Special Characters You Need to Escape in Double-Quoted Stings? There are two special characters you need to escape in a double-quote string: the double quote (") and the back slash (\). Here is a PHP script example of double-quoted strings: &lt;?php echo "Hello world!"; echo "Tom sa...
2016-10-13, 1628🔥, 0💬

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