Ad block is installed and active. Please support us by disabling it.
HomeFriday, September 22, 2017, 00:48:10
3

PHP Trim

Tuesday, February 10, 15, 13:39:21, 3 Yaers Ago Via wain, Hits: 2501
trim() Strip whitespace (or other characters) from the beginning and end of a string.
Example:
Code:
<?php
$words = "PHP is an open-source server-side scripting language";
//explode — split a string by string
$cc = explode(' ', $words);
foreach ($cc as $key => $value) {
//trim — strip whitespace from the beginning
//and end of a string
$value = trim($value);
echo " <a href=\"$value\">$value</a> ";
}
?>

Sign In

Sponsor

Related

Adodb Recordcount Example

RecordCount returns the number of rows in the record set.

Meta Tags Generator 1.1. PHP Script

This script will allow your visitors to create meta tags online.

Preg_Match - PHP Form Validation

PHP form validation with preg_match

Send This Link PHP Script

A popup form which allows your visitors to send a referral link from your site. It features admin notification and HTML output.

Prevent the error loading XML – libxml_use_internal_errors

libxml_use_internal_errors() allows you to disable standard libxml errors and enable user error handling.

Syntax highlighting in Smarty

Syntax highlighting for Smarty - Google Code Prettify

Getimagesize

Getimagesize function will determine the size of any given image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag and the correspondant HTTP content type.

ShoutBox 1.1. PHP Script

ShoutBox allows your users to post short messages on your site. The script is lightweight and very easy to install and use.

Email to Friend - PHP Script

This form allows your visitors to suggest your site to a friend. It features an HTML email format and an admin notification email.

View content in a zip file with PHP

List all files in a zip archive with PHP
About Author

cilipe

Date Registered: Mon, Feb 16, 15
Last Time Online: Wed, Feb 18, 15
So far has created 2 entries.
cilipe
This author has not yet filled in any details.