How to Automatically Capitalize a String in PHP

Share: How to Automatically Capitalize a String in PHP
PHP, one of the Internet's most popular development languages, has come a long way since its inception. We can now make use of nifty functions built into the language such as UCWords. This function in particular can save webmasters quite a bit of time in editing titles, descriptions, and editing user input.
UCWords in particular is an easy function to learn since it only accepts one argument: the string that you wish to manipulate. If done correctly, the function will then be able to capitalize the first letter of every word in a given string. Similar functions such as StrToUpper will actual capitalize each letter in the string, so be sure to make the distinction between the bunch.
UCWords is used quite a bit in sanitizing database input for first and last names. Since not every registrant on a website is going to take the time to properly capitalize their name, we use the UCWords function to ensure a sense of conformity. This is especially useful in email marketing, where addressing a registrant by their lowercased name is going to come off as unprofessional.

Share: Webmasters are quite familiar with the Meta tags used to tell search engines what their website is about, and how to display the listing in the search results. UCWords is used in this case to ensure the "Title" attribute of the website is always capitalized. This allows for better efficiency by allowing the designer to disregard capitalizing words, but also ensures there are no errors in letter casing.
By applying the UCWords function to a custom-made function, we can also alter strings to keep certain words lowercased. This is especially important for proper news resources, who know that proper title case is going to mean that some prepositions or words need to remain in lower case. By initializing an array of prepositions and selectively making them lowercased, web developers can ensure that there are no mistakes in how a title should appear.
It's important to note that the UCWords function isn't always going to render foreign characters correctly. While this should be fixed in the next version of PHP version thanks to the fact that multi-language support is being added, for now users of certain text encoding structures will have to create custom functions to get this to work properly. This is obviously a setback, but this will not affect the majority of web developers around the world.
Closing Comments
In the end, UCWords is quite a benefit to web developers. It's quite a help for everyone from editors to the general webmaster, simply because attention doesn't have to be paid to titles or database input. For more information on this function, you should consult the PHP manual or search for further examples of usage in
Now Pay Close Attention --
Using Video Testimonials to increase your websites sales and revenue is simpler than you've been told. Everyone with a website faces the same two problems:
[Problem #1] How To Build Credibility With Potential Customers
[Problem #2] How To Obtain Testimonials Which Have Been Proven To Improve Sales
Fast Video Testimonials has been solving these two problems for hundreds of satisfied customers. Fast Video Testimonials has been tried and tested and known to produce excellent results.

Share: First: Click Here For Fast Video Testimonials
Fast Video Testimonials always supplies REAL VIDEO TESTIMONIALS created specifically for your website and business.
Second: Order Your Video Testimonials Package of 1, 5 or 10 original Video Testimonials for your website.
Your new Video Testimonials will arrive within 7 days and all Video Testimonials are done by REAL PEOPLE and are guaranteed to boost your sales by up to 30%. Buy Video Testimonials today and boost your businesses online presence overnight.
Auto Gauge Know the Different Varieties The Best Automotive Spray Booths Ever Made This Article Explains A Few Things about Auto Cash Funnel Pricol Auto Parts Supplier Automotive Industry - Pricol No Credit Auto Loans – Are They Easily Available In The Market? Autoresponders With Punch Tips in Choosing a Profitable Auto Forex Trading System Auto Forex Trading Software – Making Money Effortlessly Automated Forex Trading Robots - Uncover the Truth The Truth Behind Automated Forex Trading Robots What Advantages Does Automated Forex Trading Have? Why Should You Use Automated Forex Trading Software?