pugboy Posted July 11, 2008 Share Posted July 11, 2008 To determine what elements are in a array? I would use foreach, but that doesn't tell me what each element actually is in the value... Or can I use foreach? Link to comment https://forums.phpfreaks.com/topic/114210-is-there-a-way/ Share on other sites More sharing options...
DarkWater Posted July 11, 2008 Share Posted July 11, 2008 What are you actually asking? Show some example. Link to comment https://forums.phpfreaks.com/topic/114210-is-there-a-way/#findComment-587273 Share on other sites More sharing options...
Third_Degree Posted July 11, 2008 Share Posted July 11, 2008 the print_r() function will show you them but i think you mean <?php $array = array( "key" => "value", "otherkey" => "othervalue" ); foreach( $array as $key => $value ) { print $key . ": " . $value . "<br />"; } ?> Which would print: key: value otherkey: othervalue Link to comment https://forums.phpfreaks.com/topic/114210-is-there-a-way/#findComment-587286 Share on other sites More sharing options...
cooldude832 Posted July 11, 2008 Share Posted July 11, 2008 http://us2.php.net/manual/en/function.in-array.php Link to comment https://forums.phpfreaks.com/topic/114210-is-there-a-way/#findComment-587293 Share on other sites More sharing options...
DarkWater Posted July 11, 2008 Share Posted July 11, 2008 Yeah, I don't actually know what he's asking here. =/ Link to comment https://forums.phpfreaks.com/topic/114210-is-there-a-way/#findComment-587294 Share on other sites More sharing options...
trq Posted July 11, 2008 Share Posted July 11, 2008 http://us2.php.net/manual/en/function.in-array.php You are aware cooldude that you can simply supply a function name to the end of php.net/ and there site will redirect to the appropriate location? eg; http://php.net/in_array Link to comment https://forums.phpfreaks.com/topic/114210-is-there-a-way/#findComment-587297 Share on other sites More sharing options...
cooldude832 Posted July 11, 2008 Share Posted July 11, 2008 I just go to php.net and search it anyway cause php is inconsistent in naming its functions (yes you all should do your own searching) Link to comment https://forums.phpfreaks.com/topic/114210-is-there-a-way/#findComment-587306 Share on other sites More sharing options...
Third_Degree Posted July 11, 2008 Share Posted July 11, 2008 well even if you go to php.net/fakefunction, it still searches for fakefunction, then gives you matches. I guess it's your preference though, just like I always type out http://www.google.com in my url bar then search instead of using the firefox google search box. Link to comment https://forums.phpfreaks.com/topic/114210-is-there-a-way/#findComment-587319 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.