Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. preg_match('#/.*/#', $input, $output); print_r($output);
  2. preg_match('/<td style=[^>]+>\s*(\d+%)\s*</', $str, $match); echo $match[1];
  3. try <?php $test = 'etaRadio Ratings Dump – Current at 26/03/09 DJ Joelstar 14 12 14 15 18 21 16 20.17 DJ Ant 0 0 0 0 0 0 0 0.00 DJ Jaxon 18 16 14 19 21 14 17 21.89 DJ Chuckmeister85 19 21 24 32 24 18 23 29.61 DJ Pat4life 21 20 24 28 21 18 22 28.33 DJ JessieB 0 0 0 0 0 0 0 0.00'; preg_match('/Current at\s(\d+\/\d+\/\d+)/',$test,$date); echo $date[1],"<hr />\n"; preg_match_all('/(.*)\s+(([0-9]+ ){7}[0-9\.]+)/',$test,$numbers); $dj = $numbers[1]; foreach ($dj as $k => $v) $dj[$k] = trim($v); $num = $numbers[2]; foreach ($num as $k => $v) $num[$k] = explode(' ',trim($v)); $data = array_combine($dj, $num); echo '<pre>',print_r ($data),'</pre>'; ?>
  4. sorry i miss FROM tenx Thorper
  5. try $data=str_replace(trim($links[$id]),"<a href=\"index.htm?page=designownlinks&message=".$links[$id]."\">".$links[$id]."</a>",$value);
  6. SELECT COUNT(*) as Num (SELECT * FROM log ORDER BY id LIMIT AS a WHERE live = 99
  7. if you look source of your page it's start <LINK rel="stylesheet" href="regal.css" type="text/css"> </head> <BODY> <div id="mainsite" style="text-align:center;"> <div id="toppic"><div id="topgap" style="height:70px;"> </div><div id="nav"> <div id="navgapper"> <div class="clean22" style="padding-top:7px;padding-left:5px; font-weight:bold;border-right:2px double #FFFFFF;height:30px;color:FFFFFF;"> Hello <font color="#000000"> d</font> <a href=logout.php><b>Logout</b></a> </div> </div> <div class="nav1"> <a href="regal1.php">Home</a> </div> <div class="nav1"> <a href="regal2.php">Events</a> </div> <div class="nav1"> <a href="regal3.php">Prices</a> </div> <div class="nav2"> <a href="test.php">Book</a> </div> <div class="nav1"> <a href="regal4.php">Contact Us</a> </div> </div> </div> <p><p> <HTML> <HEAD> <TITLE>Welcome To The Royal Regal Theatre!</TITLE> <META NAME="keywords" CONTENT="PHP, Classes"> </HEAD> <BODY> <HTML> <BODY> </BODY> </HTML> </BODY> </HTML> <div id="bookings"> is it look OK for you
  8. <?php $comma = ''; $sql = "SELECT * FROM tblUsers"; require("../connection.php"); $rs=mysql_db_query($DBname,$sql,$link) or die(mysql_error()); while($row = mysql_fetch_assoc($rs)) { $users = $row['usrID']; echo $comma,$users; $comma = ","; }
  9. last one (row15) doesn0t exist
  10. first name is must be "textfield1" not "textfield"
  11. FROM fixtures f, teams t WHERE t.team_id=s.team1_id change to FROM fixtures f, teams t WHERE t.team_id=f.team1_id
  12. ... ORDER BY SUBSTRING_INDEX(col_code, '-', 1), col_number
  13. ... ORDER BY FIND_IN_SET(field_name, 'Heavyweight,Lightweight,Middleweight,Featherweight,Bantamweight') http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set
  14. <?php $filea = fopen('filea.txt', 'wb'); $fileb = fopen('fileb.txt', 'wb'); $sep = ''; for($i = 1; $i <= 100; $i++) { if($i % 2) fwrite($filea, $i.$sep); else { if($i % 8 == 0) $sep = ', '; else $sep = ''; fwrite($fileb, $i. $sep); } } fclose($filea); fclose($fileb); ?>
  15. 1. check that imput is regular c cant be > t (if c > t return 0) 2. solve one specijal case for c=1 (if c=1 return ...) 3. do recursion: calculate ways that don't have Ann total is one less, and c is same (ways(c,t-1)) calcolaate ways with Ann (ways(c-1,t-1)) sum and return
  16. $result = mysql_query("select *,TEAM from tech order by TEAM, `ID`");
  17. tray to print_r(array_keys($fields)); and look which one miss
  18. try <?php $string = " <custom> probe1 <custom> probe2 </custom> probe3 </custom> <custom> probe4 </custom> <custom> probe5 </custom>"; //$regex = "/<custom>((?!.*<custom>).*)<\/custom>/s"; //preg_match_all($regex, $string, $arry, PREG_SET_ORDER); $a = explode('<custom>',$string); foreach ($a as $b){ $b = explode('</custom>',$b); if (count($b) > 1) $arry[] = $b[0]; } print_r($arry); ?>f/code]
  19. look functions array_diff() array_intersect()
  20. you can use just $title = $title[1];
  21. $ad2=(int)$ad; //or $ad2=$ad+0; //or $ad2=ltrim($ad,'0');
  22. <?php $test = '<$ SET_TITLE("TITLE_HERE") $>'; preg_match('/<\$\sSET_TITLE\("([^"]*)/i',$test,$out); print_r($out); ?>
  23. try <?php $chars = array("A","a","B","b","C","c","D","d","E","e","F","f","G","g","H","h","I","i","J","j","K","k","L","l","M","m","N","n","O","o","P","p","Q","q","R","r","S","s","T","t","U","u","V","v","W","w","X","x","Y","y","Z","z"," ","`","~","1","!","2","@","3","#","4","$","5","%","6","^","7","&","8","*","9","(","0",")","-","_","=","+","\"","|","}","{","]","[",";",":","?","/",".",">","<"); $total_number = 1; $char_num = count($chars); $len = $_GET['number']; //$len =2; for ($i=0; $i<$len;$i++) $total_number *= $char_num; for ($i=0; $i<$total_number; $i++){ $a = $i; $out = ''; for ($j=0;$j<$len;$j++){ $out = $chars[$a % $char_num].$out; $a = (int) ($a/$char_num); } // echo $out,"\n"; mysql_query("INSERT INTO `sha1` (`string`) VALUES ('$out')"); } ?> think about time for $len=2 time is in seconds if $len=3 time is in minutes $len=4 => hours for $len=5 times is in days for $len=6 times is in years etc.
  24. look http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set
×
×
  • 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.