Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-07-2005, 07:20 AM   #1
Antonio
Too lazy to set a custom title
 
Antonio's Avatar
 
Join Date: Oct 2001
Location: Spartaaaaaaaaa
Posts: 14,136
How can I capitalize only the first letter in a sentence?

I have some text that goes like this:


whatever goes here
whatever goes here too
etc

and I want to make it look like this:
Whatever goes here
Whatever goes here too


Any ideas?
Antonio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-07-2005, 07:25 AM   #2
mortenb
Confirmed User
 
mortenb's Avatar
 
Join Date: Jul 2004
Location: Denmark ICQ: 7880009
Posts: 2,203
php

put the text in a .txt file with one sentence on each line

<?php

$data = file("filename.txt");

for($i=0;$i<count($data);$i++) {
echo UCFirst($data[$i])."<br>\n";
}

?>
mortenb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-07-2005, 07:28 AM   #3
Bro Media - BANNED FOR LIFE
MOBILE PORN: IMOBILEPORN
 
Join Date: Jan 2004
Location: Tinseltown NL
Posts: 16,502
edit:

or how explained above ;)
Bro Media - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-07-2005, 07:29 AM   #4
celebx
Confirmed User
 
Join Date: Jul 2001
Location: The Netherlands
Posts: 197
<?php
$paragraphs = explode("\n", $text);
$new_paragraphs = array();
foreach ($paragraphs as $paragraph => $text) {
$ln=0;
while ($text{$ln} || $text{$ln}hahahaha' ' || $text{$ln}hahahaha0) {
if ($lnhahahaha0) {$new_paragraphs[$paragraph]=strtoupper($text{$ln});}
else {$new_paragraphs[$paragraph].=$text{$ln};}
}
$text='';
foreach ($new_paragraphs as $paragraph => $text) {
$text.=$text."\n";
}
?>
__________________
Message me for more info: ICQ 8322641 (@gmail.com).
celebx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-07-2005, 07:29 AM   #5
Antonio
Too lazy to set a custom title
 
Antonio's Avatar
 
Join Date: Oct 2001
Location: Spartaaaaaaaaa
Posts: 14,136
thanks, I'll give a try in a sec
Antonio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-07-2005, 07:31 AM   #6
celebx
Confirmed User
 
Join Date: Jul 2001
Location: The Netherlands
Posts: 197
hahahaha is 2x =
__________________
Message me for more info: ICQ 8322641 (@gmail.com).
celebx is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-07-2005, 07:32 AM   #7
Antonio
Too lazy to set a custom title
 
Antonio's Avatar
 
Join Date: Oct 2001
Location: Spartaaaaaaaaa
Posts: 14,136
hmmmm

what is the 'hahahaha' ?
Antonio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-07-2005, 07:33 AM   #8
Antonio
Too lazy to set a custom title
 
Antonio's Avatar
 
Join Date: Oct 2001
Location: Spartaaaaaaaaa
Posts: 14,136
lo you beat me to it
thanks ;)
Antonio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-07-2005, 07:36 AM   #9
Antonio
Too lazy to set a custom title
 
Antonio's Avatar
 
Join Date: Oct 2001
Location: Spartaaaaaaaaa
Posts: 14,136
Quote:
Originally Posted by mortenb
php

put the text in a .txt file with one sentence on each line

<?php

$data = file("filename.txt");

for($i=0;$i<count($data);$i++) {
echo UCFirst($data[$i])."<br>\n";
}

?>
It works,
Thanks again
Antonio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-07-2005, 08:14 AM   #10
mortenb
Confirmed User
 
mortenb's Avatar
 
Join Date: Jul 2004
Location: Denmark ICQ: 7880009
Posts: 2,203
no problem
mortenb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.