General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 12th, 2002, 07:55 PM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via Yahoo to fakker
get first letter of string..

is there a way of getting the first letter of a string?

I have a few images which begin with "t_" -- this is so that I can do a search and not show any files which begin with "t_"..

eg:

if (file begins with "t_")
{
dont show it
}
else
{
show it
}

any thoughts??

thanks...
__________________
Matt 'Fakker' Facer

mattfacer.com

Reply With Quote
  #2  
Old November 12th, 2002, 07:59 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
substr($var, 0, 2);

That should get the first 2 characters of a string.

Reply With Quote
  #3  
Old November 12th, 2002, 08:54 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 16
Or ->
PHP Code:
 $string 't_2536_file.jpg';
if ( ( 
$string[0] == 't' ) && ( $string[1] == '_' ) ) {
   
dont show it
} else {
   
show it

__________________
~ Joe Penn

We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?

Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.




Reply With Quote
  #4  
Old November 13th, 2002, 03:47 AM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via Yahoo to fakker
cheers ben, that worked perfectly!



Any ideas on how I might remove the "T_" from the string?
I use:

PHP Code:
 $filename ereg_replace("_"" "$data_pair[0]);
$tmp ereg_replace("\n"""$data_pair[0]); 


to remove the "_" and line breaks... but I'm not sure how to remove the first two chars.....

thanks!!

Reply With Quote
  #5  
Old November 13th, 2002, 03:58 AM
Lindset Lindset is offline
weirdomoderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Location: Alta, Norway
Posts: 370 Lindset User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via ICQ to Lindset Send a message via AIM to Lindset
if you're always supposed to remove only to chars from the beginning of a string, you can use: substr($var, 2)
__________________
Best Regards,
Håvard Lindset

Reply With Quote
  #6  
Old November 13th, 2002, 04:01 AM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via Yahoo to fakker
aaah suuuwweeet! cheers lindy! It works!!

thanks guys!! where would I be without you!!

hehe!

Reply With Quote
  #7  
Old November 13th, 2002, 08:06 AM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Quote:
Originally posted by fakker

where would I be without you!!



not on the moon ofcourse
__________________
Hungry for Code

Programming works best with a team over one single person

Reply With Quote
  #8  
Old February 7th, 2011, 03:27 AM
eulogypros eulogypros is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Location: US
Posts: 3 eulogypros User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 4 sec
Reputation Power: 0
You could use those eulogy examples at any time

If you have been handed the intimidating job of writing a eulogy for your cherished one's funeral service, you will likely want to read an eulogy example or two. Actually, the faster you can get your hands on to review, the better ready you will be for establishing the suitable tone and theme for your personal cherished one's eulogy. It is never easy to summarize an entire life and legacy in one single, sincere speech. But by reviewing an eulogy sample - pinpointing what truly speaks to you and ruling out what may not be as fitting inside your specific conditions - you will be sure to get the proper tone. Keep in mind the eulogy to be as unique because the dearly departed. Just only because some thing is included in an instance you have study does not always mean that it should be incorporated in the funeral speech that you're composing. Give some thought as towards the type of service you are holding for your cherished one. Remember about your cherished one's character, and the emotions of your fellow mourners. If the recently deceased was known for his pervasive sense of humor, perhaps a joke could be fitting. Otherwise, you might want to get some other's opinions on what aspects to get from any particularly touching instance you've read.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > get first letter of string..


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap