SHARE
TWEET

Untitled

a guest Oct 16th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $tab[] = 'anna';
  4. $tab[] = 'kasia';
  5. $tab[] = 'jurek';
  6. $tab[] = 'jurek';
  7. $tab[] = 'zbyszek';
  8. $tab[] = 'beata';
  9.  
  10. echo '<h1>Tablica początkowa</h1>';
  11.     foreach ($tab as $value)
  12.     {
  13.         echo $value.', ';
  14.     }
  15.     echo '<br /><br />Asort wykonanie na tablicy';
  16.     asort($tab);
  17.     foreach ($tab as $value)
  18.     {
  19.         echo $value.', ';
  20.     }
  21.     echo '<br /><br />Array_unique wykonanie na tablicy';
  22.     $tab = array_unique($tab);
  23.     foreach ($tab as $value)
  24.     {
  25.         echo $value.', ';
  26.     }
  27.     echo '<br /><br />array_reverse wykonanie na tablicy';
  28.     $tab = array_reverse($tab);
  29.     foreach ($tab as $value)
  30.     {
  31.         echo $value.', ';
  32.     }
  33.     echo '<br /><br />in_array';
  34.    
  35.    
  36.     if (in_array('zbyszek',$tab))
  37.     {
  38.         echo 'Zbyszek jest w tablicy';
  39.     }
  40.     else
  41.     {
  42.         $tab = array_values($tab);
  43.     }
  44. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top