 |
|
|  |
|
 |
13³â Àü |
http://code.google.com/p/phpquery/
PHP¿¡¼ jQuery ½ºÅ¸ÀÏ·Î DOM ¹®¼¸¦ ó¸®ÇÒ ¼ö ÀÖ´Â ¶óÀ̺귯¸®´Ù.
À̸§ÇÏ¿© PHPQuery¶ó´Â ³ð.
¾Æ·¡¿Í °°ÀÌ ÄÚµùÇÏ´Â °Í ¸¸À¸·Î ´ÙÀ½¿¡¼ ¸ðµç a¸µÅ©¸¦ Àâ¾Æ¿Í »Ñ·ÁÁÙ ¼ö ÀÖ´Ù.
require('phpQuery/phpQuery.php');
phpQuery::newDocument(file_get_contents("http://media.daum.net/cplist/list.html?cpid=45"));
print pq(".tit a")->append("<br/>\n");
ÀÚ¼¼ÇÑ ³»¿ëÀº ¸µÅ© ÂüÁ¶.
phpQuery´Â jQuery¸¦ PHP·Î Æ÷ÆÃÇÑ°ÍÀÔ´Ï´Ù. jQueryÀÇ °ÅÀÇ ¸ðµç ±â´ÉÀÌ °¡´ÉÇÏ¸ç °¡Àå ÁÁÀº°ÍÀº CSS3 ¼¿·ºÅÍ°¡ ÀÖ´Ù´Â °Ì´Ï´Ù. Çؼ ÀÌ°É·Î »çÀÌÆ®¸¦ ÆĽÌÇÏ´Â ÀÛ¾÷À» ÇÒ¼ö ÀÖÁÒ
phpQuery
°£´ÜÇÏ°Ô ¿¹Á¦¸¦ º¸¸é
phpQuery::newDocumentFileXHTML('my-xhtml.html')->find('p');
$ul = pq('ul');
foreach($ul as $v) {
echo $v;
}
my-xhtml.html¿¡¼ ÅÂ±× p¸¦ ã°í ¶Ç ul¸¦ ã¾Æ ¹è¿·Î ¸¸µé°í ±× ³»¿ëÀ» Ãâ·ÂÇϴ°̴ϴÙ.
GWT¿¡¼ µ¿ÀÛÇÏ´Â GQUERY¶ó´Â ÇÁ·ÎÁ§Æ®µµ ÀÖ´øµ¥ jQuery´Â Á¤¸» ¿©±âÀú±â Àßµµ ÆÛÁ®ÀÖ±º¿ä ¤»¤» |
|
̵̧ : 642 |
̵̧
¸ñ·Ï
|
|
|  |
|