Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Sort and Other Problems

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Sort and Other Problems

Postby Rickess » Sun Jun 09, 2013 11:23 am

Code: Select all
function array_sort_multi($array, $key,$key2)

   {
     foreach ($array as $i => $k) {
         if(! empty($array[$i][$key][$key2])){
         $sort_values[$i] = $array[$i][$key][$key2];
         }else{
         $sort_values[$i] = $array[$i];
         }
     }
     asort ($sort_values);
     reset ($sort_values);
     while (list ($arr_keys, $arr_values) = each ($sort_values)) {
          $sorted_arr[] = $array[$arr_keys];
     }
     return $sorted_arr;
   }

   function directoryPath($string, $server) {
      $stringArray = split("/",$string);
      $level = count($stringArray);

      $down = "";
      $levelCount=0;
      while($levelCount<$level-1) {
         $down .= "../";
         $levelCount++;
      }
      $returnString = "<A HREF=\"javascript:submitForm('cd', '" . $down . "')\" style='text-decoration:underline;'>&lt;" . $server . "&gt;</A>";
      foreach($stringArray as $str) {
         $down = "";
         $level = $level - 1;
         $levelCount=0;
         while($levelCount<$level) {
            $down .= "../";
            $levelCount++;
         }

         if($level>=0) {
            $returnString .= "<A HREF=\"javascript:submitForm('cd', '" . $down . "')\" style='text-decoration:underline;'>" .  $str . "</A>/";
         }
      }
      return $returnString;
   }

   function filePart($string) {
      $stringArray = explode("/",$string);
      $level = count($stringArray);
      if ($stringArray[$level-1]=="")
         return $stringArray[$level-2];
      else
         return $stringArray[$level-1];
   }


ı wanna do sort and directory path...Thıs about web based Ftp.How can I implement thıs code?I cant sort.
Rickess
New php-forum User
New php-forum User
 
Posts: 1
Joined: Sun Jun 09, 2013 11:16 am

Re: Sort and Other Problems

Postby johnj » Wed Jun 12, 2013 5:52 am

what is going wrong with the sort?
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 11 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron