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

How To Protect Special Characters in Query String
How To Protect Special Characters in Query String? - PHP Script Tips - Processing Web Forms If you want to include special characters like spaces in the query string, you need to protect them by applying the urlencode() translation function. The script below shows how to use urlencode(): &lt;?ph...
2007-04-22, 5479👍, 0💬

How To Run a PHP Script
How To Run a PHP Script? - PHP Script Tips - Downloading and Installing PHP A standard alone PHP script can be executed directly with the PHP Command Line Interface (CLI). Write the following script in a file called hello.php: &lt;?php echo "Hello world!"; ?&gt; This script can be executed b...
2007-04-22, 4787👍, 0💬

Where Are PHP Configuration Settings Stored
Where Are PHP Configuration Settings Stored? - PHP Script Tips - Downloading and Installing PHP PHP stores configuration settings in a file called php.ini in PHP home directory. You can open it with any text editor to your settings.
2007-04-22, 4837👍, 0💬

How To Support Multiple-Page Forms
How To Support Multiple-Page Forms? - PHP Script Tips - Processing Web Forms If you have a long form with a lots of fields, you may want to divide the fields into multiple groups and present multiple pages with one group of fields on one page. This makes the a long form more user-friendly. However, ...
2007-04-22, 4727👍, 0💬

How To Remove White Spaces from the Beginning and/or the End of a String
How To Remove White Spaces from the Beginning and/or the End of a String? - PHP Script Tips - PHP Built-in Functions for Strings There are 4 PHP functions you can use remove white space characters from the beginning and/or the end of a string: trim() - Remove white space characters from the beginnin...
2007-04-22, 5227👍, 0💬

How To Get the Number of Characters in a String
How To Get the Number of Characters in a String? - PHP Script Tips - PHP Built-in Functions for Strings You can use the "strlen()" function to get the number of characters in a string. Here is a PHP script example of strlen(): &lt;?php print(strlen('It\'s Friday!')); ?&gt; This script will p...
2007-04-22, 4717👍, 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, 4894👍, 0💬

How To Download and Install PHP for Windows
How To Download and Install PHP for Windows? - PHP Script Tips - Downloading and Installing PHP The best way to download and install PHP on Windows systems is to: Go to http://www.php.net, which is the official Web site for PHP. Download PHP binary version for Windows in ZIP format. Unzip the downlo...
2007-04-22, 4680👍, 0💬

How To Remove the New Line Character from the End of a Text Line
How To Remove the New Line Character from the End of a Text Line? - PHP Script Tips - PHP Built-in Functions for Strings If you are using fgets() to read a line from a text file, you may want to use the chop() function to remove the new line character from the end of the line as shown in this PHP sc...
2007-04-22, 4814👍, 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, 5014👍, 0💬

How To Get the Minimum or Maximum Value of an Array
How To Get the Minimum or Maximum Value of an Array? - PHP Script Tips - PHP Built-in Functions for Arrays If you want to get the minimum or maximum value of an array, you can use the min() or max() function. Here is a PHP script on how to use min() and max(): &lt;?php $array = array(5, 7, 6, 2,...
2007-04-22, 7171👍, 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, 5169👍, 0💬

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, 5188👍, 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 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💬

How To Truncate an Array
How To Truncate an Array? - PHP Script Tips - PHP Built-in Functions for Arrays If you want to remove a chunk of values from an array, you can use the array_splice($array, $offset, $length) function. $offset defines the starting position of the chunk to be removed. If $offset is positive, it is coun...
2007-04-21, 7564👍, 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, 4822👍, 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, 4848👍, 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 Create an Array with a Sequence of Integers or Characters
How To Create an Array with a Sequence of Integers or Characters? - PHP Script Tips - PHP Built-in Functions for Arrays The quickest way to create an array with a sequence of integers or characters is to use the range() function. It returns an array with values starting with the first integer or cha...
2007-04-21, 5128👍, 0💬

How To Convert Strings to Upper or Lower Cases
How To Convert Strings to Upper or Lower Cases? - PHP Script Tips - PHP Built-in Functions for Strings Converting strings to upper or lower cases are easy. Just use strtoupper() or strtolower() functions. Here is a PHP script on how to use them: &lt;?php $string = "PHP string functions are easy ...
2007-04-21, 5519👍, 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, 4918👍, 0💬

How To Randomly Retrieve a Value from an Array
How To Randomly Retrieve a Value from an Array? - PHP Script Tips - PHP Built-in Functions for Arrays If you have a list of favorite greeting messages, and want to randomly select one of them to be used in an email, you can use the array_rand() function. Here is a PHP example script: &lt;?php $a...
2007-04-21, 5389👍, 0💬

How To Convert the First Character to Upper Case
How To Convert the First Character to Upper Case? - PHP Script Tips - PHP Built-in Functions for Strings If you are processing an article, you may want to capitalize the first character of a sentence by using the ucfirst() function. You may also want to capitalize the first character of every words ...
2007-04-21, 5277👍, 0💬

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