wappy 0 Report post Posted September 5, 2006 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 Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted September 5, 2006 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: <?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. Share this post Link to post Share on other sites
wappy 0 Report post Posted September 6, 2006 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. Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted September 6, 2006 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. Share this post Link to post Share on other sites
wappy 0 Report post Posted September 6, 2006 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 :-) Share this post Link to post Share on other sites