หน้า 1 จากทั้งหมด 1

ฟังก์ชั่น Recursive Implode แปลงอาร์เรย์ ออกเป็นข้อความ ที่มีเครื่องหมายขั้น

โพสต์แล้ว: 16/06/2010 1:09 am
โดย mindphp
ฟังก์ชั่น Recursive Implode แปลงอาร์เรย์ ออกเป็นข้อความ ที่มีเครื่องหมายขั้น

โค้ด: เลือกทั้งหมด

function r_implode( $glue, $pieces )
{
  foreach( $pieces as $r_pieces )
  {
    if( is_array( $r_pieces ) )
    {
      $retVal[] = r_implode( $glue, $r_pieces );
    }
    else
    {
      $retVal[] = $r_pieces;
    }
  }
  return implode( $glue, $retVal );
}