ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î


PHP ¹öºí¼ÒÆ® ¾Ë°í¸®Áò
12³â Àü
PHP ¹öºí¼ÒÆ® ¾Ë°í¸®Áò
-------------------------------------------------------------------------------------------
<?php
  /*
   Esta função troca o valor de duas variáveis entre si.
   Opcional. Pode ser embutido na bolha
  */
   function swap(&$valor_1, &$valor_2) {
     $valor_1_antigo = $valor_1;
     $valor_2_antigo = $valor_2;
        
     $valor_1 = $valor_2_antigo;
     $valor_2 = $valor_1_antigo;
    }
        
    /* Array de teste */
    $arrToSort = array(1, 4, 7, 3, 8, 9, 10);
        
    /* a BOLHA! ;-) */
    for ($i = 0; $i < count($arrToSort); $i++) {
      for ($j = $i; $j < count($arrToSort); $j++) {
         if ($arrToSort[$i] > $arrToSort[$j]) {
             swap($arrToSort[$i], $arrToSort[$j]);
          }
       }
     }
        
     /* Opcional. Exibe o array de um jeito que nós podemos entender! =D */
     print_r($arrToSort);
?>
-------------------------------------------------------------------------------------------
<?php
function BubbleSort( $items ) {
    $temp = "";
    $size = count( $items );
    for( $i = 1; $i <= $size-1; $i++ ) {
         for( $j = 1; $j <= $size - 1 - $i; $j++ ) {
              if( $items[$j+1] < $items[$j] ) {
                   $temp = $items[$j];
                   $items[$j] = $items[$j+1];
                   $items[$j+1] = $temp;
              }
         }
    }
}

$items = array(31, 41, 59, 26, 41, 58);
BubbleSort( $items );
?>
-------------------------------------------------------------------------------------------
ÃßõÃßõ : 482 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,015
·£´ý¹è³Ê¼Ò½º + ·£´ý ¾ÆÀÌÇÁ·¹ÀÓ ¼Ò½º
2,014
ÀÚµ¿»õ·Î°íħ
2,013
iframe´ë½Å div¸¦ ÀÀ¿ëÇغ¸ÀÚ
2,012
´ÙÀ½Ä«Æä ¸ÞÀο¡ ¾ÆÀÌÇÁ·¹ÀÓ »ç¿ëÇϱâ
2,011
url¿¡ get°ª °¡Á®¿À±â
2,010
PHP ÀÚÁÖ ¾²´Â ÇÔ¼öµé
2,009
µð·ºÅ丮¿¡ ÀÖ´Â À̹ÌÁö ÆÄÀÏÀ» Àоîµé¿© º¸¿©ÁÖ´Â À̹ÌÁö °¶·¯¸®
2,008
µðºñ³»¿ëÀ» ¿¢¼¿ ÆÄÀÏ·Î ´Ù¿î·Îµå ½ÃÅ°´Â ¹æ¹ý
2,007
PHP¿¡¼­ MySQL Á¢¼ÓÇϱâ
2,006
PHP¿¡¼­ Á¢¼ÓÀÚ IP ¾Ë¾Æ³»±â
2,005
°Ô½ÃÆÇ°Ë»öÀ̳ª ¼îÇθô¿¡ À¯¿ëÇÑ ÀÚ¹Ù½ºÅ©¸³Æ®
2,004
¸®´ª½º ftp ¸í·É¾î ¸ðÀ½
PHP ¹öºí¼ÒÆ® ¾Ë°í¸®Áò
2,002
PHP¿¡¼­ ¼º´É °³¼±À» À§ÇÑ À¯¿ëÇÑ ÆÁ
2,001
Flex¿Í PHP¸¦ ÀÌ¿ëÇؼ­ ¸¸µç ÆÄÀϾ÷·Îµå ¼Ò½º
2,000
PHP ÇöÀç Á¢¼ÓÀÚ ÇöȲ º¸¿©ÁÖ±â
1,999
PHP Caching to speed up
1,998
post, get, cookie, session º¯¼ö È®ÀÎ
1,997
PHP ¹®ÀÚ¿­Áß ¼ýÀÚ¸¸ ÃßÃâÇϱâ
1,996
¹«Á¶°Ç ¾Ë¾Æ¾ß ÇÒ PHP ¼Óµµ Å×½ºÆ® 14 °¡Áö
1,995
PHP ¹®ÀÚ¿­ ¿¬°áÇϱâ
1,994
PHP ¼ýÀÚ ÃµÀÚ¸®¸¶´Ù ÄÞ¸¶(½°Ç¥) Âï±â
1,993
PHP - RSS ¸®´õ±â
1,992
PHP ¸ÞÀÏ(mail) ÇÔ¼ö¸¦ ÀÌ¿ëÇÑ Ã·ºÎÈ­ÀÏ Àü¼ÛÇϱâ
1,991
PHP ÇÔ¼ö °£´Ü Á¤¸®
1,990
PHP¿¡¼­ ¼¼¼Ç(session) »ç¿ëÇϱâ
1,989
PHP explode ÇÔ¼ö¸¦ ÀÌ¿ëÇÑ ¹®ÀÚ¿­ ºÐ¸®
1,988
PHP split ÇÔ¼ö¸¦ ÀÌ¿ëÇÑ ¹®ÀÚ¿­ ºÐ¸®
1,987
PHP À̸§ÀÌ °°Àº Æûű×(Form Tag)ÀÇ °ª(value) ó¸®Çϱâ
1,986
PHP ¿À´Ã³¯Â¥¸¦ ±âÁØÀ¸·Î ÀÌÀü,ÀÌÈÄ ³¯Â¥±¸Çϱâ
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.