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

How To Sort an Array by Keys
How To Sort an Array by Keys? - PHP Script Tips - PHP Built-in Functions for Arrays 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 ...
2007-04-21, 5127👍, 0💬

How To Get the ID Column Auto-Incremented
How To Get the ID Column Auto-Incremented? - PHP Script Tips - Working with MySQL Database Many tables require an ID column to assign a unique ID number for each row in the table. For example, if you have a table to hold forum member profiles, you need an ID number to identify each member. To allow ...
2007-04-14, 5123👍, 0💬

How to Find a Substring from a Given String
How to Find a Substring from a Given String? - PHP Script Tips - PHP Built-in Functions for Strings 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 ...
2007-04-21, 5120👍, 0💬

What Is the Timeout Period on Session Values
What Is the Timeout Period on Session Values? - PHP Script Tips - Understanding and Using Sessions The PHP engine has no direct settings on session timeout period. But it has a session garbage collection mechanism that you can set to remove those special files containing session values. There are 3 ...
2007-04-18, 5100👍, 0💬

How To Pad an Array with the Same Value Multiple Times
How To Pad an Array with the Same Value Multiple Times? - PHP Script Tips - PHP Built-in Functions for Arrays 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 pos...
2007-04-21, 5095👍, 0💬

How To Connect to a MySQL Sever with a Port Number
How To Connect to a MySQL Sever with a Port Number? - MySQL FAQs - PHP Connections and Query Execution If you want to connect a MySQL server with a non-default port number, you need to use the "mysql_connect($server)" function with $server in the format of "hostName:portNubmber". The tutorial exerci...
2007-05-10, 5094👍, 0💬

How To Write a String to a File with a File Handle
How To Write a String to a File with a File Handle? - PHP Script Tips - Reading and Writing Files If you have a file handle linked to a file opened for writing, and you want to write a string to the file, you can use the fwrite() function. It will write the string to the file where the file pointer ...
2007-04-23, 5092👍, 0💬

How To Convert a Character to an ASCII Value
How To Convert a Character to an ASCII Value? - PHP Script Tips - PHP Built-in Functions for Strings If you want to convert characters to ASCII values, you can use the ord() function, which takes the first charcter of the specified string, and returns its ASCII value in decimal format. ord() complem...
2007-04-21, 5092👍, 0💬

How To Read One Line of Text from a File
How To Read One Line of Text from a File? - PHP Script Tips - Reading and Writing Files If you have a text file with multiple lines, and you want to read those lines one line at a time, you can use the fgets() function. It reads the current line up to the "\n" character, moves the file pointer to th...
2007-04-22, 5063👍, 0💬

How to Loop through an Array
How to Loop through an Array? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations 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 ho...
2007-04-20, 5063👍, 0💬

What Is File Upload
What Is File Upload? - PHP Script Tips - Uploading Files to Web Servers File upload is Web page function which allows visitor to specify a file on the browser's system and submit it to the Web server. This is a very useful function for many interactive Web sites. Some examples are: Web base email sy...
2007-04-19, 5061👍, 0💬

How To Get the Number of Rows Selected or Affected by a SQL Statement
How To Get the Number of Rows Selected or Affected by a SQL Statement? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts There are two functions you can use the get the number of rows selected or affected by a SQL statement: mysql_num_rows($res) - Returns the number of rows selecte...
2007-05-10, 5050👍, 0💬

How To Tell If a Session Is New
How To Tell If a Session Is New? - PHP Script Tips - Understanding and Using Sessions There is not direct way to tell if a session is new or old. But you can design your site to have a required session value in all sessions. Then you can check the existence of this value in a session to determine if...
2007-04-17, 5044👍, 0💬

How Many Cookies Can You Set
How Many Cookies Can You Set? - PHP Script Tips - Understanding and Managing Cookies How many cookies can you set in your PHP page? The answer is depending what is the Web browser your visitor is using. Each browser has its own limit: Internet Explorere (IE): 20 Mozilla FireFox: 50 If you want to te...
2007-04-24, 5036👍, 0💬

How To Generate a Form
How To Generate a Form? - PHP Script Tips - Processing Web Forms Generating a form seems to be easy. You can use PHP output statements to generate the required &lt;FORM> tag and other input tags. But you should consider to organized your input fields in a table to make your form looks good on th...
2007-04-23, 5027👍, 0💬

Can You Add Values to an Array without a Key
Can You Add Values to an Array without a Key? - PHP Script Tips - Understanding PHP Arrays and Their Basic Operations 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...
2007-04-20, 5027👍, 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, 5015👍, 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, 5003👍, 0💬

How To Submit Values without a Form
How To Submit Values without a Form? - PHP Script Tips - Processing Web Forms 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 q...
2007-04-22, 4992👍, 0💬

How To Connect to a MySQL Sever with Default Port Number
How To Connect to a MySQL Sever with Default Port Number? - MySQL FAQs - PHP Connections and Query Execution If you want to connect a MySQL server with default port number, you can use the "mysql_connect($server)" function, where $server is the host name or IP address where the MySQL server is runni...
2007-05-10, 4990👍, 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, 4982👍, 0💬

How To Fix the INSERT Command Denied Error
How To Fix the INSERT Command Denied Error? - MySQL FAQs - Managing Tables and Running Queries with PHP Scripts The reason for getting the "1142: INSERT command denied" error is that your user accound does not have the INSERT privilege on the table or database. To resolve this error, you need to ask...
2007-05-10, 4981👍, 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, 4970👍, 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, 4970👍, 0💬

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