sasa
Staff Alumni-
Posts
2,804 -
Joined
-
Last visited
-
Days Won
1
Everything posted by sasa
-
and AND is evaluate before OR
-
try <?php $para = '010.00,1'; echo preg_replace('/0?(\d+\.\d+),(0|1)/', '\1', $para); ?>
-
having a for loop inside a mysql SELECT statement
sasa replied to micmola's topic in PHP Coding Help
change implode("' OR '", $sentence_array) to implode("','", $sentence_array) -
you can do it with waith list patern is '/[alowed characters]+/i' or with black list '[^don't alowed characters]+/'
-
in that case change to function swear_filter($string) { $bad_words = array(); $sql = mysql_query("SELECT * FROM bad_replace"); if (mysql_num_rows($sql) > 0) { while ($row = mysql_fetch_assoc($sql)) { $bad_words[] = '/' . $row['word'] . '/i'; $replacement[] = $row['replacement']; } } return preg_replace($bad_words, '*****', $string); }
-
preg_replace('/[^a-z]+/i', '-', $para);
-
are you shure that your file doesn't end with blank line?
-
hash for string 'Sasa' the md5 is '8fb802a6110a43b01ec207ddf40b5db9' try to dectipt it md5('CLUEL3SS') return '36028d755d3fb0302227d2929a4ce71a' try decription with this
-
change your function to function swear_filter($string) { $bad_words = array(); $sql = mysql_query("SELECT * FROM bad_replace"); if (mysql_num_rows($sql) > 0) { while ($row = mysql_fetch_assoc($sql)) { $bad_words[] = '/\b' . $row['word'] . '\b/i'; $replacement[] = $row['replacement']; } } return preg_replace($bad_words, $replacement, $string); }
-
try <?php $html = 'put your html data here'; //your html is tolong $html = preg_replace('/[\n\r]/', '', $html); //remove new lines $html = preg_replace('/<ul class = "tree">\s*<\/ul>/', '', $html); //remove empty lists function my_hiar($a = 'get depth'){ static $i = 0, $array = array(); if($a == 'get depth') return count ($array); $out = array(); preg_match_all('/<li>(.*?)<\/li>/', $a[1], $m); foreach($m[1] as $item) { $array[$i]++; $out[] = implode(',', $array).' : '.strip_tags($item); } if(preg_match('/\//', $a[2])){ $array[$i--] = 0; } else { $array[++$i] = 0; } $end = count($out) ? "<br />\n" : ''; return implode("<br />\n", $out).$end; } $list = preg_replace_callback('/(.*?)(<\/?ul.*?>)/', 'my_hiar', $html); $list = trim($list); $d = my_hiar(); // get max depth $list = explode("<br />\n", $list); foreach ($list as $k => $v){ $v = explode(' : ', $v); $v[0] .= str_repeat(',0', $d - count(explode(',', $v[0]))); $list[$k] = implode(' : ', $v); } $list = implode("<br />\n", $list); echo $list; ?>
-
<?php $number = 41; echo $d = ceil(log(2*$number)/log(3))," tiers<br />\n"; $x = 1; for($i = 1; $i<$d;$i++){ echo str_repeat('o', $x),"<br />\n"; $number -= $x; $x *= 3; } echo str_repeat('o', $number),"<br />\n"; ?>
-
change $NewIDNextYear = $formatted . $MaxYearResult['MaxYear']+1 . '-' . $rand_str; to $NewIDNextYear = $formatted . ($MaxYearResult['MaxYear']+1) . '-' . $rand_str;
-
in that case you only can pull data out of database chenge it and put back to db
-
when i run this script <?php $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <!-- ## --> <title>Summary - HMV Group - The Share Centre</title> <!-- ## --> <!-- {webserver} --> <!-- ## --> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="now" /> <!-- ## --> <!-- ## --> <meta name="keywords" content="the share centre"/> <meta name="googlebot" content="NOODP" /> <!-- ## --> <link href="/a/styles/style.css" rel="stylesheet" type="text/css" media="screen" /> <link href="/a/styles/digital2.css" rel="stylesheet" type="text/css" media="screen" /> <link href="/a/styles/style-print.css" rel="stylesheet" type="text/css" media="print" /> <script src="/a/js/npage.js" type="text/javascript"></script> <script type="text/javascript" src="/a/js/jquery.1.3.2.min.js"></script> <!-- ## --> </head> <body onload="inorout2();"> <div id="tsc"> <div id="dhtmltooltip"></div> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src=\'" + gaJsHost + "google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-1965154-2"); </script> <script type="text/javascript" src="/a/js/page.js"></script> <div id="page"> <div id="masthead"> <div id="header"> <div id="logoHolder"> <a rel="nofollow" href="/a/index.html"> <img src="/web/images/logo.jpg" class="ie6" alt="home - The Share Centre logo" title="home - The Share Centre logo" name="logo" /></a> </div> <div id="searchHolder"> <div id="filterHolders"> <form name="searchToggle" action=""> <input type="radio" name="searchToggle" value="search for company" id="priceSearch" /> <label for="priceSearch">price search</label> <input type="radio" name="searchToggle" value="search the site" id="siteSearch" /> <label for="siteSearch">site search</label> </form> </div> <div id="searchBoxHolder"> <div id="siteSearchHolder" class="grey-btn-headerbg"> <form action="/a/search_results.html" id="cse-search-box"> <div> <input type="hidden" name="cx" value="017193607571923671983:s67btaw2e7g" /> <input type="hidden" name="cof" value="FORID:10" /> <input type="hidden" name="ie" value="UTF-8" /> <input type="text" value="Enter keyword" class="text queryInput" id="siteTextInput" name="q" alt="website search" style="padding: 0px; border:none;" /> <button class="aero" type="submit" name="sa"><span>search</span></button> </div> </form> </div> <div id="priceSearchHolder" class="grey-btn-headerbg"> <form method="post" onsubmit="return checksubmit()" action="/cgi-bin/oicgi.exe/inet_raccount" name="companysearch" id="companysearch"> <input name="function" value="research" type="hidden" /> <input name="company" type="text" id="search" class="text queryInput" value="Investment name or code" alt="company search" /> <button class="aero" type="submit"><span>search</span></button> </form> </div> </div> </div> <div id="idLikeToHolder"> <form name="likeTo" action=""> <select name="whichLike" id="whichLike"> <option value="#" selected="selected">Quicklinks</option> <option value="/a/open-account.html">Open account</option> <option value="/a/share-account-transfer.html">Transfer in</option> <option value="/a/contact-the-share-centre.html">Contact us</option> <option value="http://blog.share.com/">Blog</option> <option value="http://www.surveymonkey.com/s.aspx?sm=i_2fpPZ39iC0lMmCfncJLBag_3d_3d">Website feedback</option> <option value="/a/forms.html">Forms</option> <option value="/a/sitemap.html">Sitemap</option> </select> </form> </div> </div> <div id="mainmenu" class="menu-tabs"> <!-- ## --> <ul> <li><a href="/a/index.html" title="Home"><span>home</span></a></li> <li><a href="/a/our-services.html" title="Our services"><span>our services</span></a></li> <li><a href="/a/learn-about-investing.html" title="Learn about investing"><span>learn about investing</span></a></li> <li><a class="current" href="/a/research-the-markets.html" title="Feedback"><span>research the markets</span></a></li> <li><a href="/a/fund-centre.html" title="fund centre"><span>fund centre</span></a></li> <li ><a href="/cgi-bin/oicgi.exe/inet_raccount?function=refresh" title="My account"><span>my account</span></a></li></ul> <!-- ## --> <div id="sign-in"> <div class="black-btn-menu"> <a href="/cgi-bin/oicgi.exe/inet_raccount?function=refresh" class="aero"><span>sign in</span></a></div> </div><!-- sign-in --> </div><!-- mainmenu --> <br class="clear" /> </div><!-- masthead --> <div id="content"> <div id="sidemenu"><ul><li class="level-one-up"><a href="/a/research-the-markets.html" title="Research the markets">Research the markets</a></li> <li class="level-two-up"><a href="/a/find-an-investment.html" title="Find an investment">Find an investment</a></li> <li class="level-three-up"><a href="/a/find-shares.html" title="Find shares">Find shares</a></li> <li class="level-four-right"><a title="Summary of financial data for HMV Group" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=summary" >Summary</a></li> <li class="level-four"><a title="Company View for HMV Group" href="/cgi-bin/oicgi.exe/inet_raccount?function=our_view&isin=GB0031575722&csi=49073" >Our View</a></li> <li class="level-four"><a title="Charts" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=charts" >Charts</a></li> <li class="level-four"><a title="Summary of price data for HMV Group" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=prices" >Prices</a></li> <li class="level-four"><a title="Trade histories and analysis for HMV Group" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=trades" >Trades</a></li> <li class="level-four"><a title="ShareCast News for HMV Group" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=news" >ShareCast News</a></li> <li class="level-four"><a title="Regulatory News for HMV Group" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=news&sub_action=rns" >Regulatory News</a></li> <li class="level-four"><a title="Broker views" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=financials&sub_action=brokers" >Broker views</a></li> <li class="level-four"><a title="Broker consensus analysis" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=financials&sub_action=forecasts" >Broker consensus analysis</a></li> <li class="level-four"><a title="Director and institutional trades for HMV Group" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=deals" >Director Deals</a></li> <li class="level-four"><a title="Financials" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=financials" >Financials - overview</a></li> <li class="level-four"><a title="Financials" href="/cgi-bin/oicgi.exe/inet_tsc_dl2?epic=HMV&csi=49073&action=financials&sub_action=fundamentals" >Financials - fundamentals</a></li></ul> </div> <div id="content-centrestrip"> </div> <div id="content-centrex"> <!--################### DYNAMIC INSERT #####################--> <h3 class="page-title">Summary</h3> <div><div class="pink-btn-menu"><h1>HMV Group (HMV)</h1><a href="/cgi-bin/oicgi.exe/inet_raccount?function=dlook¶m1=deal¶m2=GB0031575722" class="aero"><span>deal in this share</span></a></div></div> <div id="holder"> <!-- $companyPageStart --> <div> <div class="firstColHolder companyProfileDescription"> <h2 class="textHeaderUnderline">Company Overview</h2> <div class="textRegular companyProfileDescription">HMV Group listed on the London Stock Exchange in 2002 and includes the well-known HMV music and video stores and Waterstone\'s the book retailer. While predominantly a UK brand, HMV also operates stores in Japan, Hong Kong, Australia, Singapore and in Europe and North America.</div> </div> <div class="firstColHolder"> <div class="firstColLeft"> <h2 class="textHeaderUnderline">1 Day Chart </h2> <img width="285" height="150" src="http://sharecentreredesign.digitallook.com/sharecentreredesign/chart_image?finance_chart=1&co_dimension^width=285&plot_colour=&canvas_colour=&chart_primary_ticker=HMV&co_dimension^height=150&chart_time_period=1_day&tiny_chart=1&co_border^set=-1&csi=49073&ie=1&chart_action=chart_draw&transparent_canvas=&use_transparency=" alt="1 Day Chart" /> </div> <div class="firstColRight"> <h2 class="textHeaderUnderline">6 Month Chart</h2> <img width="285" height="150" src="http://sharecentreredesign.digitallook.com/sharecentreredesign/chart_image?finance_chart=1&co_dimension^width=285&plot_colour=&canvas_colour=&chart_primary_ticker=HMV&co_dimension^height=150&chart_time_period=6_month&tiny_chart=1&co_border^set=-1&csi=49073&ie=1&chart_action=chart_draw&transparent_canvas=&use_transparency=" alt="6 Month Chart" /> </div> </div> <div class="firstColHolder"> <ul class="more"><li><a href="/cgi-bin/oicgi.exe/inet_tsc_dl2?pass=1&csi=49073&action=charts&username=&ac=" >More HMV Group charts</a></li></ul> </div> <!-- $summaryChartsEnd --><div id="companySecondCol"> <!-- $priceDataTableStart --> <div class="secondColHolder"> <h2 class="secondColHeader">Price Data</h2> <div class="secondColContent"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="60%" class="dataRegularUlOn">Currency</td> <td width="40%" class="dataRegularUlOn">UK Pounds</td> </tr> <tr> <td width="60%" class="dataRegularUlOff">Price</td> <td width="40%" class="dataRegularUlOff">14.50p</td> </tr> <tr> <td width="60%" class="dataRegularUlOn">Change Today</td> <td width="40%" class="dataRegularUlOn"><span class="Negative">-0.75p</span></td> </tr> <tr> <td width="60%" class="dataRegularUlOff">Volume</td> <td width="40%" class="dataRegularUlOff">11,458,290</td> </tr> <tr> <td width="60%" class="dataRegularUlOn">18-Mar-11 Close</td> <td width="40%" class="dataRegularUlOn">14.50p</td> </tr> <tr> <td width="60%" class="dataRegularUlOff">Shares Issued</td> <td width="40%" class="dataRegularUlOff">423.59m</td> </tr> <tr> <td width="60%" class="dataRegularUlOn">Market Cap</td> <td width="40%" class="dataRegularUlOn">£61.42m</td> </tr> <tr> <td width="60%" class="dataRegularUlOff">Year End</td> <td width="40%" class="dataRegularUlOff">24-Apr-10</td> </tr> </table> </div> </div><! -- END secondColHolder --> <!-- $priceDataTableEnd --> <!-- $brokersSayStart --> <div class="secondColHolder"> <h2 class="secondColHeader">What The Brokers Say</h2> <div class="secondColContent"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="70%" class="dataRegularUlOn">Strong Buy</td> <td width="30%" class="dataRegularUlOn">0</td> </tr> <tr> <td width="70%" class="dataRegularUlOff">Buy</td> <td width="30%" class="dataRegularUlOff">0</td> </tr> <tr> <td width="70%" class="dataRegularUlOn">Neutral</td> <td width="30%" class="dataRegularUlOn">8</td> </tr> <tr> <td width="70%" class="dataRegularUlOff">Sell</td> <td width="30%" class="dataRegularUlOff">2</td> </tr> <tr> <td width="70%" class="dataRegularUlOn">Strong Sell</td> <td width="30%" class="dataRegularUlOn">4</td> </tr> <tr> <td width="70%" class="dataRegularUlOff">Total</td> <td width="30%" class="dataRegularUlOff">14</td> </tr> </table> </div> <div class="secondColContent"> <div style="text-align: center;"><img title="The broker average is sell" src="/a/digitalcorporate/images/sell.gif" /></div> </div> <div class="secondColContent"> </div></div> <!-- $brokersSayEnd --> <!-- $latestDividendsStart --> <div class="secondColHolder"> <h2 class="secondColHeader">Dividends</h2> <div class="secondColContent"> <table cellspacing="0" cellpadding="0" width="100%"> <tr> <th width="28%" class="dataRegularHeader"> </th> <th width="36%" class="dataRegularHeader">Latest</th> <th width="36%" class="dataRegularHeader">Previous</th> </tr> <tr> <td width="28%" class="dataRegularUlOn"> </td> <td width="36%" class="dataRegularUlOn">Interim</td> <td width="36%" class="dataRegularUlOn">Final</td> </tr> <tr> <td width="28%" class="dataRegularUlOff">Ex-Div</td> <td width="36%" class="dataRegularUlOff">05-Jan-11</td> <td width="36%" class="dataRegularUlOff">29-Sep-10</td> </tr> <tr> <td width="28%" class="dataRegularUlOn">Paid</td> <td width="36%" class="dataRegularUlOn">01-Feb-11</td> <td width="36%" class="dataRegularUlOn">09-Nov-10</td> </tr> <tr> <td width="28%" class="dataRegularUlOff">Amount</td> <td width="36%" class="dataRegularUlOff">0.90p</td> <td width="36%" class="dataRegularUlOff">5.60p</td> </tr> </table> </div> </div><! -- END secondColHolder --> <!-- $latestDividendsEnd --> <!-- $latestTradesStart --> <div class="secondColHolder"> <h2 class="secondColHeader">Trades for 18-Mar-2011</h2> <div class="secondColContent"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="30%" class="dataRegularHeader">Time</td> <td width="70%" class="dataRegularHeader">Volume / Price</td> </tr> <tr> <td width="30%" class="dataRegularUlOn">17:03</td> <td width="70%" class="dataRegularUlOn"><span class="Negative">107,779 @ 14.50p</span></td> </tr> <tr> <td width="30%" class="dataRegularUlOff">16:50</td> <td width="70%" class="dataRegularUlOff"><span class="Negative">33,619 @ 14.61p</span></td> </tr> <tr> <td width="30%" class="dataRegularUlOn">16:48</td> <td width="70%" class="dataRegularUlOn"><span class="Negative">59,283 @ 14.50p</span></td> </tr> <tr> <td width="30%" class="dataRegularUlOff">16:35</td> <td width="70%" class="dataRegularUlOff"><span class="Neutral">2,620,188 @ 14.50p</span></td> </tr> <tr> <td width="30%" class="dataRegularUlOn">16:29</td> <td width="70%" class="dataRegularUlOn"><span class="Negative">85,369 @ 15.00p</span></td> </tr> </table> </div> <div class="secondColContent"> </div> </div><! -- END secondColHolder --> <!-- $latestTradesEnd --> </div><!-- END secondColContent --> <!-- $sideBarEnd --> <div class="firstColHolder"><h2 class="textHeaderUnderline">Company Announcements</h2><table width="100%" cellpadding="0" cellspacing="0" border="0" class="companyNewsTable"> <tr> <td width="70%" class="dataRegularUlOn"><a href="/cgi-bin/oicgi.exe/inet_tsc_dl2?pass=1&csi=49073&action=news&story_id=4093901&rns=1">Directorate Change</a></td> <td width="12%" class="dataRegularUlOn">08-Mar-2011</td> <td width="18%" class="dataRegularUlOn">09:30</td> </tr> <tr> <td width="70%" class="dataRegularUlOff"><a href="/cgi-bin/oicgi.exe/inet_tsc_dl2?pass=1&csi=49073&action=news&story_id=4078338&rns=1">Appointment</a></td> <td width="12%" class="dataRegularUlOff">01-Mar-2011</td> <td width="18%" class="dataRegularUlOff">07:01</td> </tr> <tr> <td width="70%" class="dataRegularUlOn"><a href="/cgi-bin/oicgi.exe/inet_tsc_dl2?pass=1&csi=49073&action=news&story_id=4078320&rns=1">Trading Update</a></td> <td width="12%" class="dataRegularUlOn">01-Mar-2011</td> <td width="18%" class="dataRegularUlOn">07:00</td> </tr> </table> <ul class="more"><li><a href="/cgi-bin/oicgi.exe/inet_tsc_dl2?pass=1&csi=49073&action=news&sub_action=rns&username=&ac=" >More HMV Group company announcements</a></li></ul> </div> <div class="firstColHolder"> <h2 class="textHeaderUnderline">Fundamentals</h2> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <th width="16%" scope="col" class="dataRegularHeader"><b>Year Ending</b></th> <th width="14%" scope="col" class="dataRegularHeaderR"><b>Revenue (£m)</b></th> <th width="15%" scope="col" class="dataRegularHeaderR"><b>Pre-tax (£m)</b></th> <th width="10%" scope="col" class="dataRegularHeaderR"><b>EPS</b></th> <th width="8%" scope="col" class="dataRegularHeaderR"><b>P/E</b></th> <th width="7%" scope="col" class="dataRegularHeaderR"><b>PEG</b></th> <th width="10%" scope="col" class="dataRegularHeaderR"><b>EPS Grth.</b></th> <th width="10%" scope="col" class="dataRegularHeaderR"><b>Div</b></th> <th width="10%" scope="col" class="dataRegularHeaderR"><b>Yield</b></th> </tr> <tr> <td class="dataRegularUlOn">29-Apr-06</td> <td class="dataRegularUlOnR">1,825.90</td> <td class="dataRegularUlOnR">80.20</td> <td class="dataRegularUlOnR">17.40p</td> <td class="dataRegularUlOnR">10.3</td> <td class="dataRegularUlOnR">n/a</td> <td class="dataRegularUlOnR"><span class="Down Negative">-25%</span></td> <td class="dataRegularUlOnR">7.40p</td> <td class="dataRegularUlOnR">4.1%</td> </tr> <tr> <td class="dataRegularUlOff">28-Apr-07</td> <td class="dataRegularUlOffR">1,684.80</td> <td class="dataRegularUlOffR">18.70</td> <td class="dataRegularUlOffR">8.20p</td> <td class="dataRegularUlOffR">13.8</td> <td class="dataRegularUlOffR">n/a</td> <td class="dataRegularUlOffR"><span class="Down Negative">-53%</span></td> <td class="dataRegularUlOffR">7.40p</td> <td class="dataRegularUlOffR">6.5%</td> </tr> <tr> <td class="dataRegularUlOn">26-Apr-08</td> <td class="dataRegularUlOnR">1,874.90</td> <td class="dataRegularUlOnR">52.00</td> <td class="dataRegularUlOnR">10.10p</td> <td class="dataRegularUlOnR">12.7</td> <td class="dataRegularUlOnR">0.6</td> <td class="dataRegularUlOnR"><span class="Up Positive">+23%</span></td> <td class="dataRegularUlOnR">7.40p</td> <td class="dataRegularUlOnR">5.8%</td> </tr> <tr> <td class="dataRegularUlOff">25-Apr-09</td> <td class="dataRegularUlOffR">1,956.70</td> <td class="dataRegularUlOffR">61.30</td> <td class="dataRegularUlOffR">11.10p</td> <td class="dataRegularUlOffR">13.0</td> <td class="dataRegularUlOffR">1.3</td> <td class="dataRegularUlOffR"><span class="Up Positive">+10%</span></td> <td class="dataRegularUlOffR">7.40p</td> <td class="dataRegularUlOffR">5.1%</td> </tr> <tr> <td class="dataRegularUlOn">24-Apr-10</td> <td class="dataRegularUlOnR">2,016.60</td> <td class="dataRegularUlOnR">68.90</td> <td class="dataRegularUlOnR">12.70p</td> <td class="dataRegularUlOnR">6.5</td> <td class="dataRegularUlOnR">0.5</td> <td class="dataRegularUlOnR"><span class="Up Positive">+14%</span></td> <td class="dataRegularUlOnR">7.40p</td> <td class="dataRegularUlOnR">9.0%</td> </tr> </table> <p>a. Based on UK GAAP presentation of accounts - includes discontinued activities</p> </div> <div class="firstColHolder"> <h2 class="textHeaderUnderline fundamentalsSectionHeader">Forecasts</h2> <table width="100%" cellpadding="0" cellspacing="0"> <tr> <th width="16%" scope="col" class="dataRegularHeader"><b>Year Ending</b></th> <th width="15%" scope="col" class="dataRegularHeaderR"><b>Profit (£m)</b></th> <th width="10%" scope="col" class="dataRegularHeaderR"><b>EPS</b></th> <th width="8%" scope="col" class="dataRegularHeaderR"><b>P/E</b></th> <th width="7%" scope="col" class="dataRegularHeaderR"><b>PEG</b></th> <th width="10%" scope="col" class="dataRegularHeaderR"><b>EPS Grth.</b></th> <th width="10%" scope="col" class="dataRegularHeaderR"><b>Div</b></th> <th width="10%" scope="col" class="dataRegularHeaderR"><b>Yield</b></th> </tr> <tr> <td class="dataRegularUlOn">30-Apr-11</td> <td class="dataRegularUlOnR">28.87</td> <td class="dataRegularUlOnR">6.81p</td> <td class="dataRegularUlOnR">2.1</td> <td class="dataRegularUlOnR">n/a</td> <td class="dataRegularUlOnR"><span class="Down Negative">-46%</span></td> <td class="dataRegularUlOnR">1.04p</td> <td class="dataRegularUlOnR">9.4%</td> </tr> <tr> <td class="dataRegularUlOff">30-Apr-12</td> <td class="dataRegularUlOffR">24.46</td> <td class="dataRegularUlOffR">5.78p</td> <td class="dataRegularUlOffR">2.5</td> <td class="dataRegularUlOffR">n/a</td> <td class="dataRegularUlOffR"><span class="Down Negative">-15%</span></td> <td class="dataRegularUlOffR">0.26p</td> <td class="dataRegularUlOffR">2.4%</td> </tr> <tr> <td class="dataRegularUlOn">30-Apr-13</td> <td class="dataRegularUlOnR">29.52</td> <td class="dataRegularUlOnR">6.97p</td> <td class="dataRegularUlOnR">2.1</td> <td class="dataRegularUlOnR">0.1</td> <td class="dataRegularUlOnR"><span class="Up Positive">+21%</span></td> <td class="dataRegularUlOnR">0.73p</td> <td class="dataRegularUlOnR">6.6%</td> </tr> </table> <ul class="more"><li><a href="/cgi-bin/oicgi.exe/inet_tsc_dl2?pass=1&csi=49073&action=financials&sub_action=forecasts&username=&ac=" >HMV Group forecasts</a></li></ul> </div> <div class="firstColHolder"> <h2 class="textHeaderUnderline">ShareCast News</h2> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="companyNewsTable"> <tr> <td width="60%>" class="dataRegularUlOff"><a href="/cgi-bin/oicgi.exe/inet_tsc_dl2?pass=1&csi=49073&action=news&story_id=4119990">Sunday newspaper round-up: Barclays, Budget, Punch...</a></td> <td width="18%" class="dataRegularUlOff">20-Mar-2011</td> <td width="18%" class="dataRegularUlOff">ShareCast</td> </tr> <tr> <td width="60%>" class="dataRegularUlOn"><a href="/cgi-bin/oicgi.exe/inet_tsc_dl2?pass=1&csi=49073&action=news&story_id=4081512">Wednesday tips round-up: Provident Financial, GKN, Fresnillo...</a></td> <td width="18%" class="dataRegularUlOn">02-Mar-2011</td> <td width="18%" class="dataRegularUlOn">ShareCast</td> </tr> <tr> <td width="60%>" class="dataRegularUlOff"><a href="/cgi-bin/oicgi.exe/inet_tsc_dl2?pass=1&csi=49073&action=news&story_id=4080825">London close: Shares in late dive as Mideast worries resurface</a></td> <td width="18%" class="dataRegularUlOff">01-Mar-2011</td> <td width="18%" class="dataRegularUlOff">ShareCast</td> </tr></table> <ul class="more"><li><a href="/cgi-bin/oicgi.exe/inet_tsc_dl2?pass=1&csi=49073&action=news&sub_action=sharecast&username=&ac=">More HMV Group ShareCast news</a></li></ul> </div> <div class="firstColHolder"> <h2 class="textHeaderUnderline">Latest Director Deals</h2><p class="textRegular">No deals were found in the last 28 days.</p> </div> <div id="footerInternal"> <p class="textFooterInternal"><b>Note 1:</b> Prices and trades are provided by <a href="mailto:solutions@digitallook.com">Digital Look Corporate Solutions</a> and are delayed by at least 15 minutes. <p class="textFooterInternal"><b>Note 2:</b> Above ratios are on a \'per annum\' basis, adjusted for corporate actions and based on the fundamentals of the primary listed security. <p class="textFooterInternal"><b>Note 3:</b> Under IFRS, all figures are based on \'Continuing\' operations unless otherwise stated. <p class="textFooterInternal"><b>Note 4:</b> In the case of dual listed securities, broker recommendations and forecasts relate to the primary listing. <p class="textFooterInternal"><b>Note 5:</b> Copyright © 2011 FactSet Research Systems Inc. All rights reserved. </div> <!-- $companyNotesEnd --> </div> <!-- END (companyFirstCol, companyFirstColNoSidebar, companyFirstColNoSidebarBanner) --> </div> <br class="clear" /> <!--################ END OF DYNAMIC INSERT ###################--> </div><!-- content-centrex --> </div><!-- content --> <br class="clear" /> <div id="foldline"></div> <div id="authorisation"> <p>The Share Centre Limited is a member of the London Stock Exchange and is authorised and regulated by the Financial Services Authority and is entered in the register (<a href="http://www.fsa.gov.uk/register/" title="http://www.fsa.gov.uk/register/" target="_blank">www.fsa.gov.uk/register/</a>) under reference 146768. Registered office: Oxford House, Oxford Road, Aylesbury, Buckinghamshire, HP21 8SZ. Registered in England no. 2461949. VAT registration no. 596 3918 82.</p> </div> <div id="footer"> <div class="gallery awards"> <div class="galItem shareAward"><p><a href="/a/about-us-awards.html"><img alt="" src="/a/i/shares_awards.gif" width="145" height="104" id="shareAwardLogo" /></a></p></div> <div class="galItem ftAward"><p><a href="/a/about-us-awards.html"><img alt="" src="/a/i/ft_ic_awards.gif" width="145" height="104" id="ftAwardLogo" /></a></p></div> </div> <div id="footer-right"> <div id="footer-menu"> <ul> <li><a rel="nofollow" href="/a/contact-the-share-centre.html" title="Contact us">Contact us</a></li> <li><a rel="nofollow" href="http://blog.share.com/" title="Blog" target="_blank">Our blog</a></li> <li><a rel="nofollow" href="/a/forms.html" title="Forms">Forms</a></li> <li><a href="/a/sitemap.html" title="Sitemap">Sitemap</a></li> </ul> <ul> <li><a rel="nofollow" href="/a/about-the-share-centre.html" title="About The Share Centre">About us</a></li> <li><a rel="nofollow" href="/a/press-office.html" title="Press office">Press office</a></li> <li><a href="http://www.shareplc.com" title="Investor relations" target="_blank" rel="nofollow">Investor relations</a></li> <li><a rel="nofollow" href="/cgi-bin/oicgi.exe/inet_raccount?function=jobs" title="Jobs">Jobs</a></li> </ul> <ul> <li class="border"><a rel="nofollow" href="/a/accessibility.html" title="Accessibility">Accessibility</a></li> <li><a rel="nofollow" href="/a/risk-warnings.html" title="Risk warnings">Risk warnings</a></li> <li><a rel="nofollow" href="/a/terms-of-business.html" title="Terms of business">Terms of business</a></li> <li><a rel="nofollow" href="/a/privacy-policy.html" title="Privacy policy">Privacy policy</a></li> </ul> </div> </div> <br class="clear" /> </div> </div> <div class="copy"><p>The Share Centre Limited © 2011. The Share Centre is not responsible for the content of external sites</p></div> <script type="text/javascript"> if (typeof pagename=="undefined") pageTracker._trackPageview(); else pageTracker._trackPageview(pagename); </script> </div> </body> </html> <!-- time taken = 0.828000000001339 80 -->'; preg_match('/<td width="60%" class="dataRegularUlOff">Price<\/td> <td width="40%" class="dataRegularUlOff">([^<]+)</', $html, $matchesarray); print_r($matchesarray[1]); ?> it return 14.50p
-
$hourresult = 3600 / my_sec($time2);
-
change to $BoxSize = array("smallbox" => array("length" => 12, "width" => 10, "depth" => 2.5), "mediumbox" => array("length" => 30, "width" => 20, "depth" => 4), "largebox" => array("length" => 60, "width" => 40, "depth" => 11.5)); change '=' to '=>' after "smallbox", "mediumbox" and "largebox" keys
-
<?php $a= rand(1,3); $b = rand(1, 3); while($a == $b)$b=rand(1,3); echo "$a - $b"; ?>
-
1 hours is 3600 seconds just 3600 divide with my_sec($time)
-
<?php $myFile = "dump.txt"; $fh = fopen($myFile, 'r'); $theData = fread($fh, filesize($myFile)); fclose($fh); preg_match('/<td width="60%" class="dataRegularUlOff">Price<\/td> <td width="40%" class="dataRegularUlOff">([^<]+)</', $theData, $matchesarray); print_r($matchesarray[1]); ?> pattern for preg_match is: <td width="60%" class="dataRegularUlOff">Price<\/td> <td width="40%" class="dataRegularUlOff"> <-- some text before price (i hope that is static) ([^<]+) <-- one or more characters different that '<' < <-- first character after price
-
try <?php preg_match('/<td width="60%" class="dataRegularUlOff">Price<\/td> <td width="40%" class="dataRegularUlOff">([^<]+)</', $html, $matchesarray); print_r($matchesarray[1]); ?> where is $html source of page
-
can you post your html file in your example is more open <ul> tags then closed </ul>
-
for 2nd <?php function my_sec($a){ $a = explode(':', $a); $out = $a[0]; for($i=1;$i<count($a);$i++){ $out *= 60; $out += $a[$i]; } return $out; } $time1 = '02:30:00'; $time2 = '30:00'; echo my_sec($time1) / my_sec($time2); ?>
-
try <?php $e = get_headers('http://www.phpfreaks.com/media/images/forums/logo.png'); if(preg_match('/OK/', $e[0])) echo 'TRUE'; else echo 'FALSE'; //print_r($e); ?>
-
you can use DISTINCT statement too select DISTINCT contributors from table where id=id
-
if(!preg_match('/[^,]/', $string)) echo 'TRUE'; else echo 'FALSE';