|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
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... |
|
#2
|
|||
|
|||
|
substr($var, 0, 2);
That should get the first 2 characters of a string. |
|
#3
|
|||
|
|||
|
Or ->
PHP Code:
__________________
~ 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. |
|
#4
|
|||
|
|||
|
cheers ben, that worked perfectly!
Any ideas on how I might remove the "T_" from the string? I use: PHP Code:
to remove the "_" and line breaks... but I'm not sure how to remove the first two chars..... thanks!! |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
aaah suuuwweeet! cheers lindy! It works!!
thanks guys!! where would I be without you!! hehe! ![]() |
|
#7
|
|||
|
|||
|
Quote:
not on the moon ofcourse
__________________
Hungry for Code Programming works best with a team over one single person
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > get first letter of string.. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|