Problem with Array/Shuffle

Discussion in 'PHP' started by pedong, May 25, 2008.

  1. #1
    this code is working

    $pictures = array('100_2021.JPG', '100_7688.JPG');

    shuffle($pictures);



    why this code is not working

    $clean = '100_7688.JPG';

    $clean2 = 'carmel.jpg';

    $clean = "' ".$clean."' "." , "."' ".$clean2. " ' " ;

    $pictures = array($clean);

    shuffle($pictures);



    Please Help
     
    pedong, May 25, 2008 IP
  2. wongjowo

    wongjowo Peon

    Messages:
    73
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    why don't you try this?

    $clean = '100_7688.JPG';
    $clean2 = 'carmel.jpg';
    $pictures = array($clean, $clean2);
    shuffle($pictures);
     
    wongjowo, May 25, 2008 IP
  3. pedong

    pedong Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3

    does it mean that you can't store literal texts separated by comma into a single variable and use it in array?
     
    pedong, May 25, 2008 IP
  4. TeraTask

    TeraTask Peon

    Messages:
    37
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    TeraTask, May 25, 2008 IP
  5. pedong

    pedong Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Does it mean that you can directly answer my question?... Thanks anyway
     
    pedong, May 27, 2008 IP