php½âÎöxmlʾÀý
<!-- xml ¸ñʽ
<books>
<book id='1001'>
<author>andylin</author>
<title>c language</title>
<publisher id="aaa">O'Reilly</publisher>
</book>
<book id='1002'>
<author>congfeng</author>
<title>C++ Designer</title>
<publisher id='bbb'>New Publish</publisher>
</book>
</books>
-->
<?php
$dom = new DOMDocument();
if (!$dom->load('books.xml'))
{
echo "load books.xml failed!<br>";
return;
}
$books = $dom->getElementsByTagName('book');
foreach ($books as $book)
{
//get book id
$book_id = $book->getAttribute('id');
//get author
$nodeAuth = $book->getElementsByTagName('author');
$strAuth = $nodeAuth->item(0)->nodeValue;
//get publisher
$nodePub = $book->getElementsByTagName('publisher');
$strPub = $nodePub->item(0)->nodeValue;
$pub_id = $nodePub->item(0)->getAttribute('id');
//get title
$nodeTitle = $book->getElementsByTagName('title');
$strTitle = $nodeTitle->item(0)->nodeValue;
//save data
$arrInfo['book_id'] = $book_id;
$arrInfo['author'] = $strAuth;
$arrInfo['publiser'] = $strPub;
$arrInfo['title'] = $strTitle;
$arrInfo['pub_id'] = $pub_id;
//save info
$arrInfos[] = $arrInfo;
}
var_dump($arrInfos);
?>
Ïà¹ØÎĵµ£º
PHP ÖÐÓÉÓÚÊý×éºÍ×Ö·û´®ÕâÁ½ÖÖ±äÁ¿ÀàÐÍÊÇÈç´Ë³£Óã¬ÒÔÖÁÓÚ PHP ¾ßÓÐÁ½¸öº¯Êý£¬¿ÉÒÔÔÚ×Ö·û´®ºÍÊý×éÖ®¼ä»¥Ïà½øÐÐת»»¡£
¡¡¡¡$array=explode(separator,$string);
¡¡¡¡$string=implode(glue,$array);
¡¡¡¡Ê¹ÓúÍÀí½âÕâÁ½¸öº¯ÊýµÄ¹Ø¼üÖ®´¦ÊÇ·Ö¸ô·û£¨separator£©ºÍ½ººÏ·û£¨glue£©¹ØÏµ¡£µ±°ÑÒ»¸öÊý×éת»»³ÉÒ»¸ö×Ö·û´®Ê±£¬½«»áÉ ......
×Ô¼º×öÏîÄ¿ÐèÒªÓÃÖÇÄܿͻ§¶Ë·¢²¼£¬ÎÒÓöµ½Á˸öÎÊÌâ¾ÍÊdzÌÐòÖеÄxmlÎļþÔÚ·¢²¼ºóÕÒ²»µ½ÁË¡£¾¹ýÔÚÍøÉϲéѯºÍ×Ô¼ºµÄÊÔÑé·¢ÏÖÕâÁ½¸ö·½·¨¶¼¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ¡£
·½·¨1
ÓÒ¼üwinUIÏîÄ¿£¬·¢²¼-¡µÓ¦ÓóÌÐòÎļþ....->Ñ¡ÔñxmlÎļþ-¡µ·¢²¼×´Ì¬¸ÄΪ“Êý¾ÝÎļþ(×Ô¶¯)”
&nb ......
×î½üÔÚѧϰphp£¬Ò³ÃæÒѾ×öºÃÁË£¬ÏÖÔÚ¾ÍÊǺÍÐéÄâ»úÀïC´úÂëµÄͨÐÅ£¬socket±à³Ì»¹¿ÉÒÔ£¬¾ÍÊÇÄÃÊý¾ÝµÄ´¦Àí£¬ÄÑ£¬¡£
ÀàµÄ±à³ÌÎÒ²»»á£¬Ã»ÓÐѧ¹ýC++¡£±¾À´´òËãÓýṹÌåµÄ£¬¿ÉÊÇPHPÀïÃæ¾ÓȻûÓнṹÌ壬Ôõô°ìÄØ£¿¼ÌÐøÅ¬Á¦°É
......
×î½ü·¢ÏֺܶàÍøÕ¾¶¼ÓÐһЩȦÈËÍ·ÏñµÄ¹¦ÄÜ£¬ºóÀ´ÔÚÍøÉÏGGÁËһϣ¬·¢ÏÖÊÇÓÃOpenCVʵÏֵģ¬ÎÒÒ²ÔÚÄÚ²¿·þÎñÆ÷×öÁËһϲâÊÔ£¬Èç¹û¿ÉÒÔʵÏÖ£¬²½ÖèÈçÏ£º
Ò» °²×°
1¡¢°²×°opencv
¹Ù·½ÍøÕ¾£ºhttp://www.opencv.org.cn £¨ÖÐÎİ棩
¾ßÌå°²×°·½·¨¿ÉÒԲο¼¹Ù·½ÍøÕ¾£º
http://www.opencv.org.cn/index.php/%E6%BA%90%E7%A0%81%E7% ......