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

How To Loop through an Array without Using "foreach"
How To Loop through an Array without Using "foreach"? - PHP Script Tips - PHP Built-in Functions for Arrays 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 an...
2007-04-14, 5291👍, 0💬

How To Break a File Path Name into Parts
How To Break a File Path Name into Parts? - PHP Script Tips - Working with Directoris and Files If you have a file name, and want to get different parts of the file name, you can use the pathinfo() function. It breaks the file name into 3 parts: directory name, file base name and file extension; and...
2007-04-23, 5290👍, 0💬

How To Force the PHP Engine to Use Cookies to Transfer Session IDs
How To Force the PHP Engine to Use Cookies to Transfer Session IDs? - PHP Script Tips - Understanding and Using Sessions If you want to force your PHP engine to use cookies to transfer session IDs instead of URL parameters, you can open the PHP configuration file, php.ini, and make the following cha...
2007-04-18, 5284👍, 0💬

How To Reformat a Paragraph of Text
How To Reformat a Paragraph of Text? - PHP Script Tips - PHP Built-in Functions for Strings 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 NO...
2007-04-21, 5283👍, 0💬

Can You Copy an Array
Can You Copy an Array? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations You can create a new array by copying an existing array using the assignment statement. Note that the new array is not a reference to the old array. If you want a reference variable pointing to the old arr...
2007-04-20, 5283👍, 0💬

How To Turn on mysql Extension on the PHP Engine
How To Turn on mysql Extension on the PHP Engine? - MySQL FAQs - PHP Connections and Query Execution The "mysql" API extension is provided as "php_mysql.dll" for Windows system. Your PHP binary download package should have "php_mysql.dll" included. No need for another download. But you need to check...
2007-05-10, 5277👍, 0💬

What Is the Best Way to Test the strpos() Return Value
What Is the Best Way to Test the strpos() Return Value? - PHP Script Tips - PHP Built-in Functions for Strings 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 ...
2007-04-21, 5271👍, 0💬

How To Delete an Existing Rows in a Table
How To Delete an Existing Rows in a Table? - PHP Script Tips - Working with MySQL Database If you want to remove a row from a table, you can use the DELETE statement with a WHERE clause to identify the row. The following sample script deletes one row: &lt;?php include "mysql_connection.php"; $sq...
2007-04-14, 5270👍, 0💬

How To Access MySQL Servers through Firewalls
How To Access MySQL Servers through Firewalls? - MySQL FAQs - PHP Connections and Query Execution If your MySQL server is provided by an Internet service company, connecting to the server from your local machine will not be so easy, because there are firewalls between your local machine and your MyS...
2007-05-10, 5261👍, 0💬

How To Remove Leading and Trailing Spaces from User Input Values
How To Remove Leading and Trailing Spaces from User Input Values? - PHP Script Tips - PHP Built-in Functions for Strings If you are taking input values from users with a Web form, users may enter extra spaces at the beginning and/or the end of the input values. You should always use the trim() funct...
2007-04-22, 5261👍, 0💬

How To Copy Array Values to a List of Variables
How To Copy Array Values to a List of Variables? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations If you want copy all values of an array to a list of variable, you can use the list() construct on the left side of an assignment operator. list() will only take values with integ...
2007-04-20, 5261👍, 0💬

How To Test the Session Garbage Collection Process
How To Test the Session Garbage Collection Process? - PHP Script Tips - Understanding and Using Sessions In order to test the session garbage collection process, you need to change the settings to expire session variables in 10 seconds and run the process on every request: session.gc_probability = 1...
2007-04-18, 5261👍, 0💬

What Is a Result Set Object
What Is a Result Set Object? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts A result set object is a logical representation of data rows returned by mysql_query() function on SELECT statements. Every result set object has an internal pointer used to identify the current row in t...
2007-05-10, 5260👍, 0💬

How To Move Uploaded Files To Permanent Directory
How To Move Uploaded Files To Permanent Directory? - PHP Script Tips - Uploading Files to Web Servers 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_uploade...
2007-04-19, 5255👍, 0💬

How To Generate and Process a Form with the Same Script
How To Generate and Process a Form with the Same Script? - PHP Script Tips - Processing Web Forms In previous exercises, a Web form is generated by one script, and processed by another script. But you could write a single script to do both. You just need to remember to: Use same script name as the f...
2007-04-22, 5236👍, 0💬

How To Get the Directory Name out of a File Path Name
How To Get the Directory Name out of a File Path Name? - PHP Script Tips - Working with Directoris and Files If you have the full path name of a file, and want to get the directory name portion of the path name, you can use the dirname() function. It breaks the full path name at the last directory p...
2007-04-23, 5234👍, 0💬

How To Specify Input Values for Radio Buttons
How To Specify Input Values for Radio Buttons? - PHP Script Tips - Processing Web Forms Radio buttons can be used in a form for two situations: As a single switch - One &lt;INPUT TYPE=RADIO ...> tag, with no input value specified. When submitted with button pushed down, you will receive a value ...
2007-04-23, 5232👍, 0💬

How To Find a Specific Value in an Array
How To Find a Specific Value in an Array? - PHP Script Tips - PHP Built-in Functions for Arrays 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 retur...
2007-04-20, 5224👍, 0💬

In Which Does File FireFox Store Persistent Cookies
In Which Does File FireFox Store Persistent Cookies? - PHP Script Tips - Understanding and Managing Cookies If you change FireFox to keep cookies "until they expire", FireFox will store persistent cookies from all Web servers in a single file at: \Documents and Settings\$user\Application Data\Mozill...
2007-04-24, 5212👍, 0💬

How To Create a Web Form
How To Create a Web Form? - PHP Script Tips - Processing Web Forms 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 &lt;FORM> ...
2007-04-23, 5210👍, 0💬

How To Check Your PHP Installation
How To Check Your PHP Installation? - PHP Script Tips - Downloading and Installing PHP 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 "\...
2007-04-22, 5198👍, 0💬

How To Get All the Keys Out of an Array
How To Get All the Keys Out of an Array? - PHP Script Tips - PHP Built-in Functions for Arrays 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(): &lt;?php $mixed = array(); $mixed["Zero"] = "PHP"; $mixed[1] = "P...
2007-04-21, 5196👍, 0💬

How To Perform Key Word Search in Tables
How To Perform Key Word Search in Tables? - PHP Script Tips - Working with MySQL Database The simplest way to perform key word search is to use the SELECT statement with a LIKE operator in the WHERE clause. The LIKE operator allows you to match a text field with a keyword pattern specified as '%keyw...
2007-04-19, 5196👍, 0💬

How To Save Values to the Current Session
How To Save Values to the Current Session? - PHP Script Tips - Understanding and Using Sessions When session is turned on, a session will be automatically created for you by the PHP engine. If you want to save any values to the session, you can use the pre-defined associative array called $_SESSION....
2007-04-18, 5192👍, 0💬

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