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

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

How To Read a Text File into an Array
How To Read a Text File into an Array? - PHP Script Tips - Reading and Writing Files If you have a text file with multiple lines, and you want to read those lines into an array, you can use the file() function. It opens the specified file, reads all the lines, puts each line as a value in an array, ...
2007-04-22, 5182👍, 0💬

How To Remove Values Saved in the Current Session
How To Remove Values Saved in the Current Session? - PHP Script Tips - Understanding and Using Sessions If you want to remove values saved in the current session, you should use the unset() function on those saved values in $_SESSION, or use array() to empty $_SESSION: unset($_SESSION['MyColor']) - ...
2007-04-17, 5182👍, 0💬

How To Detect File Uploading Errors
How To Detect File Uploading Errors? - PHP Script Tips - Uploading Files to Web Servers If there was a problem for a file upload request specified by the &lt;INPUT TYPE=FILE NAME=fieldName...> tag, an error code will be available in $_FILES[$fieldName]['error']. Possible error code values are: U...
2007-04-19, 5175👍, 0💬

Where Are the Session Values Stored
Where Are the Session Values Stored? - PHP Script Tips - Understanding and Using Sessions When a value is saved into the current session by one PHP page, the PHP engine must stored this value somewhere on Web server, so that the PHP engine can retrieve it back when same visitor comes back to request...
2007-04-18, 5175👍, 0💬

How To Get the Total Number of Values in an Array
How To Get the Total Number of Values in an Array? - PHP Script Tips - PHP Built-in Functions for Arrays You can get the total number of values in an array by using the count() function. Here is a PHP example script: &lt;?php $array = array("PHP", "Perl", "Java"); print_r("Size 1: ".count($array...
2007-04-20, 5171👍, 0💬

How Are Cookies Encoded During Transportation
How Are Cookies Encoded During Transportation? - PHP Script Tips - Understanding and Managing Cookies When cookies are transported from servers to browsers and from browsers back to servers, Cookies values are always encoded using the URL encoding standard to ensure that they are transported accurat...
2007-04-24, 5170👍, 0💬

How To Replace a Substring in a Given String
How To Replace a Substring in a Given String? - PHP Script Tips - PHP Built-in Functions for Strings If you know the position of a substring in a given string, you can replace that substring by another string by using the substr_replace() function. Here is a PHP script on how to use substr_replace()...
2007-04-21, 5167👍, 0💬

Can You Define an Array Argument as a Reference Type
Can You Define an Array Argument as a Reference Type? - PHP Script Tips - Creating Your Own Functions You can define an array argument as a reference type in the function definition. This will automatically convert the calling arguments into references. Here is a PHP script on how to define an array...
2007-04-24, 5166👍, 0💬

How Session IDs Are Transferred on Your Web Server
How Session IDs Are Transferred on Your Web Server? - PHP Script Tips - Understanding and Using Sessions As you know there are two options the PHP engine can use to transfer session IDs to the client browsers. But how to do know which option is your PHP engine is using? The PHP sample script will he...
2007-04-18, 5157👍, 0💬

How Arrays Are Passed Through Arguments
How Arrays Are Passed Through Arguments? - PHP Script Tips - Creating Your Own Functions Like a normal variable, an array is passed through an argument by value, not by reference. That means when an array is passed as an argument, a copy of the array will be passed into the function. Modifying that ...
2007-04-24, 5154👍, 0💬

How Do You If a Key Is Defined in an Array
How Do You If a Key Is Defined in an Array? - PHP Script Tips - PHP Built-in Functions for Arrays There are two functions can be used to test if a key is defined in an array or not: array_key_exists($key, $array) - Returns true if the $key is defined in $array. isset($array[$key]) - Returns true if ...
2007-04-20, 5145👍, 0💬

How To Query Multiple Tables Jointly
How To Query Multiple Tables Jointly? - PHP Script Tips - Working with MySQL Database If you want to query information stored in multiple tables, you can use the SELECT statement with a WHERE condition to make an inner join. Assuming that you have 3 tables in a forum system: "users" for user profile...
2007-04-19, 5145👍, 0💬

How To Open Standard Output as a File Handle
How To Open Standard Output as a File Handle? - PHP Script Tips - Reading and Writing Files If you want to open the standard output as a file handle yourself, you can use the fopen("php://stdout") function. It creates a special file handle linking to the standard output, and returns the file handle....
2007-04-23, 5140👍, 0💬

What Is a Cookie
What Is a Cookie? - PHP Script Tips - Understanding and Managing Cookies A cookie is a small amount of information sent by a Web server to a web browser and then sent back unchanged by the browser each time it accesses that server. HTTP cookies are used for authenticating, tracking, and maintaining ...
2007-04-25, 5139👍, 0💬

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

What Is the Common Mistake When Setting Path and Domain on Temporary Cookies
What Is the Common Mistake When Setting Path and Domain on Temporary Cookies? - PHP Script Tips - Understanding and Managing Cookies A common mistake made by many PHP developers is using an empty string for the expiration time parameter when setting path and domain for temporary cookies. The PHP scr...
2007-04-24, 5134👍, 0💬

How To Read Data from Keyborad (Standard Input)
How To Read Data from Keyborad (Standard Input)? - PHP Script Tips - Reading and Writing Files If you want to read data from the standard input, usually the keyboard, you can use the fopen("php://stdin") function. It creates a special file handle linking to the standard input, and returns the file h...
2007-04-23, 5133👍, 0💬

How To Close MySQL Connection Objects
How To Close MySQL Connection Objects? - MySQL FAQs - PHP Connections and Query Execution MySQL connection objects created with mysql_connect() calls should be closed as soon as you have finished all of your database access needs by calling mysql_close($con) function. This will reduce the consumptio...
2007-05-10, 5129👍, 0💬

How To Take a Substring from a Given String
How To Take a Substring from a Given String? - PHP Script Tips - PHP Built-in Functions for Strings If you know the position of a substring in a given string, you can take the substring out by the substr() function. Here is a PHP script on how to use substr(): &lt;?php $string = "beginning"; pri...
2007-04-21, 5129👍, 0💬

How To Convert Strings to Numbers
How To Convert Strings to Numbers? - PHP Script Tips - Understanding String Literals and Operations In a numeric context, PHP will automatically convert any string to a numeric value. Strings will be converted into two types of numeric values, double floating number and integer, based on the followi...
2007-04-20, 5128👍, 0💬

How To Append New Data to the End of a File
How To Append New Data to the End of a File? - PHP Script Tips - Reading and Writing Files If you have an existing file, and want to write more data to the end of the file, you can use the fopen($fileName, "a") function. It opens the specified file, moves the file pointer to the end of the file, and...
2007-04-22, 5127👍, 0💬

What Is the Scope of a Variable Defined outside a Function
What Is the Scope of a Variable Defined outside a Function? - PHP Script Tips - Creating Your Own Functions A variable defined outside any functions in main script body is called global variable. However, a global variable is not really accessible globally any in the script. The scope of global vari...
2007-04-24, 5126👍, 0💬

How View the Content of a Cookie File
How View the Content of a Cookie File? - PHP Script Tips - Understanding and Managing Cookies Cookie files are normal text files. You can view them with any text editor. Follow the steps below to see what is in a cookie file created by your own PHP script. Copy the following sample script, setting_p...
2007-04-24, 5123👍, 0💬

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