Jump to content

ki

Members
  • Posts

    208
  • Joined

  • Last visited

Posts posted by ki

  1. hey guys, havent asked something in awhile but now ive got this new question

     

    I got help from someone on making data from an array turn into links with this function:

     

     function searchLinks($searchStr) {
      $searchAry = explode(",", $searchStr);
    
        foreach ($searchAry as $key => $term) {
         $searchAry[$key] = "<a href=\"search.php?t=".urlencode(trim($term))."\">" . trim($term) . "</a>";
        }
    
      $searchStr = implode(", ", $searchAry);
    return $searchStr;
    }

     

    what I want it to do is also detect breaks such as "\n"

     

    so it would also treat breaks as it being seperated and returning back to a break

  2. How do you get the title of a(n) external webpage? Ive seen it done on the vBulletin's software. Anyone know how to exactly do this? Or is there a PHP function already added to the PHP software that I don't know about.

  3. okay with a bit of tampering i figured out how to do it:

     

    srand((double)microtime()*1000000);
    $aFriends = explode(",", $p1->friends);
    foreach ($aFriends as $key => $term) {
    $aFriends[$key] = $term;
    }
    $rFriends = array_rand($aFriends, 2);
    echo $aFriends[$rFriends[0]];
    echo $aFriends[$rFriends[1]];

    hope that helps someone in the future

  4. okay my array would end like this:

    $aFriends = array(1,2,3,4,5,6,7);
    $rFriends = array_rand($aFriends, 6);
    for ($i=0; $i<6; $i++) {
    echo $rFriends[$i];
    }

    I want it to randomly choose the numbers that are found in the array.

    so for example it would ed out like:

    5,1,7,3,2,4

    and so on

     

    and no im not having any error issues

  5. okay basically my problem is that my info isnt displaying.

    my code:

    $aFriends = array($p1->friends);
    $rFriends = array_rand($aFriends, 6);
    for ($i=0; $i<=6; $i++) {
    echo $aFriends[$rFriends[$i]];
    }
    

     

    $p1->friends is pulled from a mysql db and has for example: 1, 3, 4, 5, 7, 9, 10, 15

     

    what I wanted it to do was pull 6 random numbers from the array and its not doing that :/

    any help would be appreciated

  6. Im having a blank,

     

    I have this list

     

    <ul>
    <li>DYNAMIC CONTENT</li>
    <li>DYNAMIC CONTENT</li>
    <li>DYNAMIC CONTENT</li>
    </ul>

     

    they're all having different values of space going in, but I want them to be the same length so that when I hover over them it will look even not based on the size that each individual li is. any help so they're all the same size? without width because u don't know how big they are actually going to be

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.