![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Nov 2005
Location: Estonia
Posts: 97
Rep Power: 0
![]() |
if in
I can do this in python:
if "asdf" in list: do stuff Can I do something like that to an associative array in PHP? |
|
|
|
|
|
#2 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 773
Rep Power: 3
![]() |
You can use the in_array() to see if the value exists, and if you're looking for a key then you could probably combine that with array_keys()
__________________
<insert disclaimer here> <insert shameless plug for Visual Studio here> |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Nov 2005
Location: Estonia
Posts: 97
Rep Power: 0
![]() |
Thanks Jimbo! But there's no generic if in like thing?
|
|
|
|
|
|
#4 |
|
Programmer
Join Date: Jul 2005
Posts: 62
Rep Power: 4
![]() |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|