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

How To Join Multiple Strings Stored in an Array into a Single String
How To Join Multiple Strings Stored in an Array into a Single String? - PHP Script Tips - PHP Built-in Functions for Arrays 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 ...
2007-04-21, 5464👍, 0💬

How To Split a String into an Array of Substring
How To Split a String into an Array of Substring? - PHP Script Tips - PHP Built-in Functions for Arrays 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) ...
2007-04-22, 5460👍, 0💬

How To Use an Array as a Stack
How To Use an Array as a Stack? - PHP Script Tips - PHP Built-in Functions for Arrays A stack is a simple data structure that manages data elements following the first-in-last-out rule. You use the following two functions together to use an array as a stack: array_push($array, $value) - Pushes a new...
2007-04-21, 5448👍, 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, 5446👍, 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, 5444👍, 0💬

How To Retrieve the Submitted Form Data
How To Retrieve the Submitted Form Data? - PHP Script Tips - Processing Web Forms The best way to retrieve the form data submitted by your visitor is to use the $_REQUEST array. The keys in this array will be the field names defined in form. The values in this array will be the values entered by you...
2007-04-23, 5434👍, 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, 5431👍, 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, 5422👍, 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, 5416👍, 0💬

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

How To Connect to MySQL Severs with User Accounts
How To Connect to MySQL Severs with User Accounts? - MySQL FAQs - PHP Connections and Query Execution If you want to connect a MySQL server with user account name and password, you need to call mysql_connect() with more parameters like this: $con = mysql_connect($server, $username, $password); If yo...
2007-05-10, 5398👍, 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, 5394👍, 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, 5393👍, 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, 5392👍, 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, 5385👍, 0💬

What Are the Input Values of SELECT Tags
What Are the Input Values of SELECT Tags? - PHP Script Tips - Processing Web Forms SELECT tags are used in forms to provide dropdown lists. Entris in a dropdown list are defined by OPTION tags, which can provide input values in two ways: Implicit value - Provided as &lt;OPTION>input_value& ;lt...
2007-04-23, 5381👍, 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, 5336👍, 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, 5336👍, 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, 5325👍, 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, 5321👍, 0💬

What Is a Persistent Cookie
What Is a Persistent Cookie? - PHP Script Tips - Understanding and Managing Cookies A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. By default, cookies are created as temporary cookies which stored only in the browser's memory. When the browser...
2007-04-25, 5306👍, 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, 5301👍, 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, 5291👍, 0💬

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