A simple method for removing accents from strings in PHP:
1 2 $x = strtr($x, "ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ", "SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy");
|
|||||
|
A simple method for removing accents from strings in PHP: 1 2 $x = strtr($x, "ŠŒŽšœžŸ¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ", "SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy"); Strings in PHP can be specified in four different ways: single quoted, double quoted, heredoc syntax and (since PHP 5.3.0) nowdoc syntax, the first two of them being by far the most frequently used. When do we use single quotations, when do we use double quotations and which are the differences between them? . . . → Read More: Single quotations vs double quotations in PHP Very often we need to display only the beginning of a larger text and for this we have substr() function. But we would like to do that without cutting any words (think of poorly truncated words like “butterfly” or “assassin”). This is a very quick fix for the above problem: 1 2 3 4 . . . → Read More: Substr without cutting words One of the most common and overused type of operation a web developer needs to perform is no doubt string manipulation. Very often strings need to be trimmed and chopped, cleaned of unwanted characters, chunk split into little pieces, glued back in a different order, encrypted and decoded back and forth, searched through, reversed, . . . → Read More: Getting the substrings between given delimiters |
|||||
|
Copyright © 2012 Need code for … - All Rights Reserved |
|||||
Recent Comments