richie_ropey Posted March 16, 2006 Share Posted March 16, 2006 hi, i have some code[code] $j = 0; if (isset($_SESSION['c_a_num_fields'])) { for ($i=0; $i < $_SESSION['c_a_num_fields']; $i++) { if (isset($_SESSION['c_asset_value_'.$i.''])) { $sort[$j] = $_SESSION['c_asset_value_'.$i.'']; $j++; } } for ($i=0; $i < $_SESSION['c_a_num_fields']; $i++) { $_SESSION['c_asset_value_'.$i.''] = $sort[$i]; } }$j = 0;[/code]this idea of this code is to sort $_SESSION['c_asset_value_'.$i.''] so that $i goes:12345instead of13458(just an example), the reason for this happening is to do with deleting cirtain sessions, mainly cause i dont want to use the database for this sort of stuff.this code dosnt work (though i think the logic looks good :|), i was wondering if theres:a) anyway to fix the current codeb) alternative codec) a session function to do this for me (ive looked in the php manual and saw somthing about session_regenerate_id, but i dont understand how it works)thanks - Rich Link to comment https://forums.phpfreaks.com/topic/5091-sorting-a-session/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.