WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World
Set/Get substitution character

mb_substitute_character

(PHP 4 >= 4.0.6, PHP 5)

mb_substitute_characterSet/Get substitution character

Description

mixed mb_substitute_character ([ mixed $substrchar ] )

Specifies a substitution character when input character encoding is invalid or character code does not exist in output character encoding. Invalid characters may be substituted NULL (no output), string or integer value (Unicode character code value).

This setting affects mb_convert_encoding(), mb_convert_variables(), mb_output_handler(), and mb_send_mail().

Parameters

substrchar

Specify the Unicode value as an integer, or as one of the following strings:

  • "none" : no output
  • "long" : Output character code value (Example: U+3000,JIS+7E7E)

Return Values

If substchar is set, it returns TRUE for success, otherwise returns FALSE. If substchar is not set, it returns the Unicode value, or "none" or "long".

Examples

Example #1 mb_substitute_character() example

<?php
/* Set with Unicode U+3013 (GETA MARK) */
mb_substitute_character(0x3013);

/* Set hex format */
mb_substitute_character("long");

/* Display current setting */
echo mb_substitute_character();
?>


A very useful function to display text on specified number of characters.
Categories : PHP, Strings
Wraps a HTML(!) string to a given number of characters using a string break character
Categories : PHP, Strings, HTML and PHP
Creating thumbnails from MySQL Blobs online
Categories : PHP, MySQL, Graphics, HTML and PHP, Databases



Scramble Eggs - php class to scramble/encode
Categories : PHP, PHP Classes, Security, Encryption
Validating Credit Card Numbers Without Bank Involvement
Categories : Credit Cards, Ecommerce, Java Script
Special HTML Characters
Categories : HTML
Counting the number of words in user-supplied text
Categories : PHP, Strings
Linked comboboxes with php-mysql & javascript
Categories : PHP, Java Script, Databases, MySQL
Credit Card Numbers for testing
Categories : Credit Cards, Ecommerce, Debugging
PHP Function to Encrypt/Decrypt a string without a known key. The string itself has his own different key for every character.
Categories : PHP, Algorithms, Security, Authentication, Encryption
Format US phone number version 2. Rewritten to have an invalid statement output, and to include a extension number, up to four digets.
Categories : PHP, Regexps
How to build a search query for any N number of words in a search string
Categories : PHP, Regexps, Search Engines, Search
Easy to use random number function that seeds with uniqid and allows a max value
Categories : Math., PHP
Prime number finder (Sieve of Erastothenes)
Categories : PHP, Algorithms, Math.