PHP - Do Any Phpfreaks Speak Or Study Japanese? にほんご はなせますか?
In my spare time I have been coding a website to teach Japanese to English speakers. I am almost done with the first two modules (I started out planning on 2 modules but I'm up to 10 planned modules). I would be very interested in feedback and any suggestions for things that would be helpful in learning the language in general if there is anyone who knows or is learning Japanese.
Similar TutorialsHello Guys,
This is Muneeb from Spain, an intermediate level PHP student coming from StackOverFlow, I was forced to leave the webssite because everyone there has become so professional that they have started bullying you.
So here I am landed now, hoping to meet "actually" nice knowledge givers
Id like to introduce myself as Noxin, I came into building sites earlier this year I've completed several sites as training so far. Each time learning and expanding my knowledge my latest site I have half completed easily, I think people in the industry would say I've completed the front end. But this time I'm adding login's registration and payment systems I think this is know as the back end of a site. I came to this site because I really need some help from people who really knows PHP. So I've been on google and youtube trying to pick up as much knowledge as I could to self teach myself, but the things people say to type in for example: I'd like to give a example but I'm not home yet. But a error will come back on my xammp server as a error on line 4 or something. So I don't know if php code changes for the different patches that comes out or something or if the stuff people have been saying to type is wrong. All I know is I'm using notepad++ and I have xammp with php 5.6.3 Any help would be fantastic and sorry for the long intro. Noxin I have a breadcrumb scrpt that works well except I want it to be like the breadcrumb script here on phpfreaks. I need to get parts of the url that the script gets to create the trail and query the database to replace those parts of the url. Say i have a url like mydomain.com/forum/1/2, where 1 is the board and 2 topic, how would i change the code so if the part[1] was forum it replaces parts 2 and 3 with what it's in the database? Here is my breadcrumb script function breadcrumb( $home = 'Home', // Name of root link $division = ' / ', // Divider between links $hidextra = true, // Toggle hide/show get data and fragment in text $index = false, // Toggle show/hide link to directory if it does not contain a file $indexname = 'index.php' // The definition of the file the directory must contain ) { $breadcrumb=""; // Requested addons... $extension = '.php'; // Extension to cut off the end of the TEXT links $ifIndex = 'index.php'; // Filename of index/default/home files to not display // End requested addons $whole = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $parts = explode('/', $whole); $parts[0] = 'http://'.$parts[0]; $array = array('-', '%20'); $breadcrumb .= "<a href=\"{$parts[0]}\">{$home}</a>{$division}"; $k = 1; for ($i=1;$i < sizeof($parts);$i++) { $uri = '/'; while ($k <= $i) { $uri .= $parts[$k]; if ($k != (sizeof($parts)-1)) $uri .= '/'; $k++; } if (($index && is_dir($_SERVER['DOCUMENT_ROOT'].$uri) && is_file($_SERVER['DOCUMENT_ROOT'].$uri.$indexname) || !$index || !is_dir($_SERVER['DOCUMENT_ROOT'].$uri)) && $parts[$i] != $ifIndex) { $breadcrumb .= "<a href=\"$uri\">"; if ($hidextra) { $breadcrumb .= rtrim(preg_replace("/\?.*$/", '', ucwords(str_replace($array," ",$parts[$i]))), $extension); } else { $breadcrumb .= rtrim(ucwords($parts[$i]), $extension); } $breadcrumb .= '</a>'; } else { $breadcrumb .= ucwords(str_replace($array," ",$parts[$i])); } if (isset($parts[($i+1)])) { $breadcrumb .= $division; } $k = 1; } return $breadcrumb; } I have a string of mixed Japanese or Chinese and Western characters and I would really like to leave the western characters and remove the others. Is there any way to detect which UTF-8 characters are Japanese/Chinese and to remove them? I have tried to use this which I found on another thread but my version of PHP (5.3) will not allow the /u in the following Code: [Select] echo "<BR>".preg_replace('/[^\u4E00-\u9FFF]+/', '', $string); I have tried using various combinations of /p (these, plus others) Code: [Select] echo "<BR>".preg_replace('/\p{Bopomofo}+/u', '', $string); echo "<BR>".preg_replace('/\p{Hiragana}+/u', '', $string); and the /x{} option tells me the numbers are to large Code: [Select] echo "<BR>".preg_replace('/[^\x{4E00}-\x{9FFF}]+/', '', $string); My string for this example is this but any combination of western and Japanese/Chinese characters are possible in the title. 2011.12.06 19:00-20:00 / ふくいちライブカメラ (Live Fukushima Nuclear Plant Cam) | Uploaded: 06 Dec 2011 Thanks for any help. I always have trouble formatting my HTML in PHP. I want to create a total at the bottom of each uomptrucknumber to show the total for all the orders on that truck. I have included a screen shot of the output.
So I want to put a row that adds up the order totals and show that total for every truck number. before the next truck number. <html> <head> <title>Loads Between Dates</title> </head> <body> <style> table { border: 1px solid #B0CBEF; border-width: 1px 0px 0px 1px; font-size: 14pt; font-family: Calibri; font-weight: 100; border-spacing: 0px; border-collapse: collapse; } TH { background-image: url(excel-2007-header-bg.gif); background-repeat: repeat-x; font-weight: normal; font-size: 17px; border: 1px solid #9EB6CE; border-width: 0px 1px 1px 0px; height: 17px; } TD { border: 0px; padding: 0px 4px 0px 2px; border: 1px solid #D0D7E5; border-width: 0px 1px 1px 0px; width: 100px; } TD B { border: 0px; background-color: white; font-weight: bold; } TD.heading { background-color: #E4ECF7; text-align: center; border: 1px solid #9EB6CE; border-width: 0px 1px 1px 0px; } </style> <?php $loadid = '0'; $loadTotal=0; $beginDate=$_POST["begin"]; $endDate=$_POST["end"]; $connect =odbc_connect("removed"); if(!$connect) { exit("Connection Failed: " . $connect); } $gr_total = 0; $sql="select * from (select convert(varchar,ompRequestedShipDate,101) as ShipDate,UOMPTRUCKNUMBER,UOMPDROPSEQUENCE ,ompSalesOrderID , ompCustomerOrganizationID, sum(omlOrderQuantity) as QTY, UOMPVOLUMETOTAL, sum(omlExtendedPriceBase) as total from m1_kf.dbo.SalesOrders left outer join m1_kf.dbo.SalesOrderLines on omlSalesOrderID=ompSalesOrderID where ompClosed !=-1 and ompRequestedShipDate >= '$beginDate' and ompRequestedShipDate <= '$endDate' and ompCustomerPO not like '%void%' and UOMPTRUCKNUMBER !='' group by ompRequestedShipDate,UOMPTRUCKNUMBER,UOMPDROPSEQUENCE ,ompSalesOrderID,ompCustomerOrganizationID,UOMPVOLUMETOTAL) as cte order by UOMPTRUCKNUMBER ,UOMPDROPSEQUENCE,ompSalesOrderID,ompCustomerOrganizationID" ; $result =odbc_exec($connect,$sql); if(!$result){ exit("Error in SQL"); } function ShowDetail($row){ echo "<tr><td>".$row['ShipDate']."</td>"; echo "<td>" .$row['UOMPDROPSEQUENCE']."</td>"; echo "<td>" .$row['ompSalesOrderID']."</td>"; echo "<td>" .$row['ompCustomerOrganizationID']."</td>"; echo "<td>" .round($row['QTY'],0)."</td>"; echo "<td>" .($row['UOMPVOLUMETOTAL'])."</td>"; echo "<td align = 'right'>" .$row['total']."</td>"; } //**************************************************************** while ($row = odbc_fetch_array($result)) { echo "<table>"; echo "<tr style='background:#82fbfd'>"; if($row['UOMPTRUCKNUMBER'] != $loadid) { echo '<th>'.$row['UOMPTRUCKNUMBER']."</th>"; echo "<th>Drop</th>"; echo "<th>OrderID</th>"; echo "<th>CustID</th>"; echo "<th>QTY</th>"; echo "<th>Cubes</th>"; echo "<th>Total</th></tr>"; $TotalPcs=0; $loadTotal=0; } ShowDetail($row); $loadid = $row['UOMPTRUCKNUMBER']; $TotalPcs+=round($row['QTY'],0); $loadTotal +=$row['total']; } echo "</table>"; //****************************************************************** ?>
|