Jump to content

phpcodec

Members
  • Posts

    51
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

phpcodec's Achievements

Member

Member (2/5)

0

Reputation

  1. This image here is generated by php: http://nanopets.net/woa/signature.php?pet_id=14 is it possible to insert an image like this into that image like a layer: http://nanopets.net/woa/images/adults/ice_lizard_adult.png
  2. Excellent, but still one more problem instead of getting the full url like this "downloadfile.php?file=xxx.zip" it just gets "downloadfile.php"
  3. It works but it doesnt work if their is multiple hyperlinks in the string
  4. Here is the code i use $string = 'this is a test <a href="www.iwanturl.com">I want URLS</a> this is a test'; echo preg_replace('/^<a href="[-:_.\/a-zA-Z0-9]+">[-:_.\/a-zA-Z0-9]+<\/a>/','',$string);
  5. Hi, i am having problems writing a regex script that will take a string of text with hyperlinks in and extracting just the hyperlinks I have made several attempts and so far failed can someone help?
  6. Ok thanks, i fixed it anyway using array_rand()
  7. I have a session issue $types = array("diamonds","hearts","spades","clubs"); $cards = array("Ace","2","3","4","5","6","7","8","9","10","Jack","Queen","King"); $possible_cards = array(); foreach($types AS $type) { foreach($cards AS $card) { $possible_cards[] = strtolower($card).':of:'.$type; } } I have this code to generate card names such as "8:of:diamonds" and such, this works fine this is the print_r result of $possible_cards array Array ( [0] => ace:of:diamonds [1] => 2:of:diamonds [2] => 3:of:diamonds [3] => 4:of:diamonds [4] => 5:of:diamonds [5] => 6:of:diamonds [6] => 7:of:diamonds [7] => 8:of:diamonds [8] => 9:of:diamonds [9] => 10:of:diamonds [10] => jack:of:diamonds [11] => queen:of:diamonds [12] => king:of:diamonds [13] => ace:of:hearts [14] => 2:of:hearts [15] => 3:of:hearts [16] => 4:of:hearts [17] => 5:of:hearts [18] => 6:of:hearts [19] => 7:of:hearts [20] => 8:of:hearts [21] => 9:of:hearts [22] => 10:of:hearts [23] => jack:of:hearts [24] => queen:of:hearts [25] => king:of:hearts [26] => ace:of:spades [27] => 2:of:spades [28] => 3:of:spades [29] => 4:of:spades [30] => 5:of:spades [31] => 6:of:spades [32] => 7:of:spades [33] => 8:of:spades [34] => 9:of:spades [35] => 10:of:spades [36] => jack:of:spades [37] => queen:of:spades [38] => king:of:spades [39] => ace:of:clubs [40] => 2:of:clubs [41] => 3:of:clubs [42] => 4:of:clubs [43] => 5:of:clubs [44] => 6:of:clubs [45] => 7:of:clubs [46] => 8:of:clubs [47] => 9:of:clubs [48] => 10:of:clubs [49] => jack:of:clubs [50] => queen:of:clubs [51] => king:of:clubs ) I make a loop statement to add random card names into sessions for($i=1;$i<=6;$i++) { $rand = rand(0,sizeof($possible_cards)); $_SESSION['blackjack_your_card_'.$i] = $possible_cards[$rand]; unset($possible_cards[$rand]); $rand = rand(0,sizeof($possible_cards)); $_SESSION['blackjack_dealer_card_'.$i] = $possible_cards[$rand]; unset($possible_cards[$rand]); } this is where the problem lies, some of the session variables such as $_SESSION['blackjack_dealer_card_3'] will be filled in as blank instead of "9:of:clubs" or whatever Could anyone help me find the source of this problem?
  8. How can i write a regex that will check for any characters that are not in the list below and return true if any unknown characters are found a-z A-Z 0-9 _ (under-dash) - (hypen) (space)
  9. on line 99 it should be echo "<td width=\"20\">" . $row['Alloy'] ."</td>";
  10. My site has a series of folders and i want these to be hidden by not showing a directory listing of all the files, how can i achieve this without placing a index page in each folder?
  11. I need help with a php function Their is a function that counts the amount of instances of a string that is in another string so here is a example $letter = 'a'; $line = 'my name is phpcodec and i like to code php and asp'; their are 4 instances of $letter in $line
  12. I have a table which has a column "signed_up" and that is filled with a php timestamp with php time() how can i show the users who have signed up today? I have tried this, but it doesnt work $date = date("Y-m-d"); $sql = mysql_num_rows(mysql_query("SELECT * FROM np_users WHERE DATE(signed_up)='$date'")); echo '<br />Registered Today: '.number_format($sql);
×
×
  • 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.