so basicly i want only the first 2 characters of a variable and chop of the rest.
know what im talking about,
like Alabama becomes AL, or Idaho ID, so if you know something to capitalize them aswell it would be even better.
variable chopping
Started by Av-, Nov 21 2005 04:15 PM
3 replies to this topic
#1
Posted 21 November 2005 - 04:15 PM
#2
Posted 21 November 2005 - 04:25 PM
I believe i've told you this before, but use php.net, it has answers to all the questions you can think to ask (don't ask me how, just take my word).
http://php.net/manua...tion.substr.php
http://php.net/manua....strtoupper.php
Also note, since i'm assuming you're using this to get state abbreviations, how would you do New Jersey/New York?
http://php.net/manua...tion.substr.php
http://php.net/manua....strtoupper.php
Also note, since i'm assuming you're using this to get state abbreviations, how would you do New Jersey/New York?
#3
Posted 21 November 2005 - 04:35 PM
well, no, i was just using the states as an example 
well thanks anyway, you helped me out
and i did look at php.net btw, i just didnt know what to search for
well thanks anyway, you helped me out
and i did look at php.net btw, i just didnt know what to search for
#4
Posted 21 November 2005 - 04:40 PM
Guide to php.net
If you're looking for some sort of string modification, look for things that have "str" in them.
If you want to do something with array's. Search for "array" and then find the array() function on that page, click the link. Look in the left hand nav for everything you can do to arrays.
Same concept for everything else (i.e. for anything dealing with an image, search for "image" and work fromt here).
If you're looking for some sort of string modification, look for things that have "str" in them.
If you want to do something with array's. Search for "array" and then find the array() function on that page, click the link. Look in the left hand nav for everything you can do to arrays.
Same concept for everything else (i.e. for anything dealing with an image, search for "image" and work fromt here).
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
