|
|
|
|
![]() ![]() |
Sep 5 2006, 10:45 AM
Post
#1
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 164 Joined: 2-July 06 From: England Member No.: 25,974 |
right i was wondering if someone could help me with this:
I notice on this site if i make a topic for example WAppY rOCks WaP, it will come out like Wappy Rocks Wap. I also want to do this to my forums, can anyone give me the code to format a string of text in this way? THANKS IN ADVANCE |
|
|
|
Sep 5 2006, 11:05 AM
Post
#2
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,969 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
PHP has a selection of string modifying functions to handle this. In fact you will have to use two of them together in the following fashion:
CODE <?php $foo = 'HeLlO wOrLd!'; echo $foo; $foo = ucwords(strtolower($foo)); echo $foo; ?> Untested, but it should work exactly as you want. It is slightly modified from the php manual. The strtolower function converts the entire string to lowercase and then the ucwords function converts the starting character of each word to uppercase. How and when and where these functions need to be applied to your Forum is another topic and would be dependent on the Forum specific coding. Essentially, use this code whenever the topic title is displayed. |
|
|
|
Sep 6 2006, 12:41 AM
Post
#3
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 164 Joined: 2-July 06 From: England Member No.: 25,974 |
Many thanks :-)
i should of really looked at php.net for this (now i realise how simple it is). Its just i made a mod for my wap forums where the latest replied to topic is shown above my forum categories. I (when making categories) use this format of writing but other users don't so i wanted to format it so it appears this way and matches my categories, just a small detail to make it look more professional. |
|
|
|
Sep 6 2006, 01:08 AM
Post
#4
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,969 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
The php Manual can be downloaded to your desktop / Laptop so that it is readily available even if you are off line at the time. It only takes a few minutes ant then you are never without it.
|
|
|
|
Sep 6 2006, 10:10 AM
Post
#5
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 164 Joined: 2-July 06 From: England Member No.: 25,974 |
Yes i know this but i work from a symbian phone (nokia 6630) and have built my site and also browse with this. I have a pc but its broken and i won't have money to fix it for a while. So i can't really use the php manual on this as i believe its like a 2mb file, if i open a file so big while im browsing it will slow me down way to much. But yes i will download it anyway. I find the web site more helpfull though with its search and examples :-)
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 30th August 2008 - 03:20 AM |