The Little Guy Posted November 2, 2012 Share Posted November 2, 2012 (edited) Is it possible to exit an array_walk_recursive? I tried doing return true/false but it still goes through all the options, is there a way for it to break out? What I wanted to do was to test certain values within a session, but the values are in different locations of the session. We have an unknown amount of steps to test, and an unknown amount of options in each step, and we only want to test the "required" fields. If it isn't possible, I guess I will just have to do nested foreach loops. Example Session Layout: $_SESSION["ad"]["fields"]["step1"]["required"][$field_name] = "some value"; $_SESSION["ad"]["fields"]["step1"]["required"][$field_name] = "some value"; $_SESSION["ad"]["fields"]["step2"]["required"][$field_name] = "some value"; $_SESSION["ad"]["fields"]["step2"]["optional"][$field_name] = "some value"; $_SESSION["ad"]["fields"]["step3"]["required"][$field_name] = "some value"; $_SESSION["ad"]["fields"]["step3"]["required"][$field_name] = "some value"; $_SESSION["ad"]["fields"]["step3"]["optional"][$field_name] = "some value"; Edited November 2, 2012 by The Little Guy Quote Link to comment https://forums.phpfreaks.com/topic/270203-exit-array_walk_recursive/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.