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

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

How To Get Some Basic Information Back from MySQL Servers
How To Get Some Basic Information Back from MySQL Servers? - MySQL FAQs - PHP Connections and Query Execution Once you got a MySQL server connection object successfully, you can use mysql_get_server() and mysql_get_host_info() to get some basic information from your MySQL server. The tutorial exerci...
2007-05-10, 4964👍, 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, 4960👍, 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, 4956👍, 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, 4947👍, 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, 4945👍, 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, 4928👍, 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, 4922👍, 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, 4912👍, 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, 4912👍, 0💬

How To Get a List of Databases from MySQL Servers
How To Get a List of Databases from MySQL Servers? - MySQL FAQs - PHP Connections and Query Execution Once you got a MySQL server connection object successfully, you need to know what databases are available on the server and which database you should use to manage your tables and data. To get a lis...
2007-05-10, 4899👍, 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, 4897👍, 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, 4896👍, 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, 4879👍, 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, 4873👍, 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, 4869👍, 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, 4868👍, 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, 4857👍, 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, 4847👍, 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, 4839👍, 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, 4837👍, 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, 4828👍, 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, 4826👍, 0💬

How To Replace a Group of Characters by Another Group
How To Replace a Group of Characters by Another Group? - PHP Script Tips - PHP Built-in Functions for Strings 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 for...
2007-04-20, 4825👍, 0💬

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