sasa
Staff Alumni-
Posts
2,804 -
Joined
-
Last visited
-
Days Won
1
Everything posted by sasa
-
preg_match('#/.*/#', $input, $output); print_r($output);
-
preg_match('/<td style=[^>]+>\s*(\d+%)\s*</', $str, $match); echo $match[1];
-
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>'; ?>
-
sorry i miss FROM tenx Thorper
-
try $data=str_replace(trim($links[$id]),"<a href=\"index.htm?page=designownlinks&message=".$links[$id]."\">".$links[$id]."</a>",$value);
-
SELECT COUNT(*) as Num (SELECT * FROM log ORDER BY id LIMIT AS a WHERE live = 99
-
[SOLVED] Differences between Firefox and Internet Explorer
sasa replied to DanielHardy's topic in PHP Coding Help
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 -
<?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 = ","; }
-
last one (row15) doesn0t exist
-
first name is must be "textfield1" not "textfield"
-
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
-
[SOLVED] Order BY- two columns of different types in mysql
sasa replied to avvllvva's topic in PHP Coding Help
... ORDER BY SUBSTRING_INDEX(col_code, '-', 1), col_number -
... 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
-
<?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); ?>
-
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
-
$result = mysql_query("select *,TEAM from tech order by TEAM, `ID`");
-
tray to print_r(array_keys($fields)); and look which one miss
-
is some nested tags inside "<custom>" tags
-
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]
-
look functions array_diff() array_intersect()
-
you can use just $title = $title[1];
-
$ad2=(int)$ad; //or $ad2=$ad+0; //or $ad2=ltrim($ad,'0');
-
<?php $test = '<$ SET_TITLE("TITLE_HERE") $>'; preg_match('/<\$\sSET_TITLE\("([^"]*)/i',$test,$out); print_r($out); ?>
-
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.
-
look http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set