解决方案 »
- 有没有sns源码,拜求前辈
- 屏幕自动适应怎么做到的?
- smarty里foreach的索引问题
- 关于php将html转化成pdf的问题
- 求一个二级域名的整站
- 离职获准,离开后我打算自己做一个物流信息网站
- dede首页图片展示的位置在哪个文件夹
- Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resourc
- php 如何从sqlserver中的二进制图片读取出来显示到页面里?
- php在iis7.5下跟apache的运行效率问题
- 用php来做windows漏洞补丁下载,求思路……
- 如何用PHP代码 远程控制Linux服务器
preg_match_all('/<a[\d\D]*>\s*(\$[\d\.]+)/i', $str, $matches);
print_r($matches[1][0]);
/*
输出结果:
$39.00
*/
要是 是下面的文本 如何获得呢?$25.00Desktop Package Intel E3400 to Intel E5400 CPU Upgrade Kit PCDIY (NSW, SA, VIC) | www.pcdiy.com.au | updated: 07-05-2011 $39.00Desktop Package Intel E3400 to Intel E6500 CPU Upgrade Kit PCDIY (NSW, SA, VIC) | www.pcdiy.com.au | updated: 07-05-2011 $46.99Intel BX80571E3400 CELERON E3400/ 2.60GHz/ 1MB CACHE/ 800FSB/ LGA775 GREENBOXiT (NSW) | www.greenboxit.com.au | updated: 20-07-2011 $47.00BX80571E3400 Intel CPU Celeron Dual Core E3400 / 2.60GHz / 1MB Cache / 800F...Centre Com (VIC) | www.centrecom.com.au | updated: 17-07-2011 $47.00Intel Dual Core Celeron E3400 2.60GHZ (LGA775) CPU Genuine Retail Box MSY (ACT, NSW, QLD, SA, VIC, WA) | www.msy.com.au | updated: 20-07-2011 $48.00Intel Celeron Dual Core E3400 2.6GHZ 800FSB LGA775 UMart Online - Brisbane Southside (QLD) | www.umart.com.au | updated: 20-07-2011 $48.00Intel Celeron Dual Core E3400 2.6GHZ 800FSB LGA775 UMart Online - QLD (QLD) | www.umart.com.au | updated: 20-07-2011 $48.00Intel Celeron E3400, 2.60GHz/1MB CACHE/800FSB/LGA775 (BX80571E3400) Gocomp (QLD) | www.gocomp.com.au | updated: 20-07-2011 $48.00Intel Celeron Dual Core E3400 2.6GHZ 800FSB LGA775 Umart Online - Melbourne (VIC) | www.umart.com.au | updated: 20-07-2011 $48.93Intel Celeron E3400 DC 2.60GHZ 1M Cache [BX80571E3400]E3400 - INTEL CELERON... MegaBuy Technology Superstore (QLD) | www.megabuy.com.au | updated: 20-07-2011 $49.00Intel Celeron Dual Core E3400 2.6GHZ 800FSB LGA775 UMart Online - Sunshine Coast (QLD) | www.umart.com.au | updated: 20-07-2011 $49.00Intel Celeron E3400 Wolfdale 2.6GHz 1MB L2 Cache LGA 775 65W Dual-Core Desk... iiBuy (NSW) | www.iibuy.com.au | updated: 20-07-2011 $50.00CPU/Processor Intel S775 Celeron Dual Core E3400 (2.4GHz) IT Estate (NSW) | www.itestate.com.au | updated: 20-07-2011 $50.82Intel Dual Core Celeron E3400 CPU, 2.60GHz/800MHz FSB/1MB cache/LGA775, Dua...ARC Computers (NSW) | www.arc.com.au | updated: 20-07-2011 $51.00Intel Dual Core Cel E3400 2.6G 1Mb; Dual Core Retail Box HS&F 800Mhz FSB; L... NetPlus (WA) | www.netplus.com.au | updated: 20-07-2011 $51.00Intel Dual Core Celeron E3400 CPU 2.60 GHz 800MHz FSB 1MB cache Socket LGA7...Foxcomp Technology (WA) | www.foxcomp.com.au | updated: 20-07-2011 $51.00INTEL BX80571E3400 CELERON E3400 2.60GHz 1MB CACHE 800FSB LGA775Foxcomp Technology (WA) | www.foxcomp.com.au | updated: 20-07-2011 $51.11Intel Dual Core Celeron E3400 CPU, 2.60 GHz, 800MHz FSB, 1MB cache, Socket ...Excel Computers (NSW) | www.excelcomputers.com.au | updated: 17-07-2011 $52.75INTEL BX80571E3400 CELERON E3400/2.60GHZ/1MB CACHE/800 ...Computer Wholesale (NSW) | www.computerwholesale.com.au | updated: 15-07-2011 $52.95
<?php
$str = "
$25.00Desktop Package Intel E3400 to Intel E5400 CPU Upgrade Kit PCDIY (NSW, SA, VIC) | www.pcdiy.com.au | updated: 07-05-2011 $39.00Desktop Package Intel E3400 to Intel E6500 CPU Upgrade Kit PCDIY (NSW, SA, VIC) | www.pcdiy.com.au | updated: 07-05-2011 $46.99Intel BX80571E3400 CELERON E3400/ 2.60GHz/ 1MB CACHE/ 800FSB/ LGA775 GREENBOXiT (NSW) | www.greenboxit.com.au | updated: 20-07-2011 $47.00BX80571E3400 Intel CPU Celeron Dual Core E3400 / 2.60GHz / 1MB Cache / 800F...Centre Com (VIC) | www.centrecom.com.au | updated: 17-07-2011 $47.00Intel Dual Core Celeron E3400 2.60GHZ (LGA775) CPU Genuine Retail Box MSY (ACT, NSW, QLD, SA, VIC, WA) | www.msy.com.au | updated: 20-07-2011 $48.00Intel Celeron Dual Core E3400 2.6GHZ 800FSB LGA775 UMart Online - Brisbane Southside (QLD) | www.umart.com.au | updated: 20-07-2011 $48.00Intel Celeron Dual Core E3400 2.6GHZ 800FSB LGA775 UMart Online - QLD (QLD) | www.umart.com.au | updated: 20-07-2011 $48.00Intel Celeron E3400, 2.60GHz/1MB CACHE/800FSB/LGA775 (BX80571E3400) Gocomp (QLD) | www.gocomp.com.au | updated: 20-07-2011 $48.00Intel Celeron Dual Core E3400 2.6GHZ 800FSB LGA775 Umart Online - Melbourne (VIC) | www.umart.com.au | updated: 20-07-2011 $48.93Intel Celeron E3400 DC 2.60GHZ 1M Cache [BX80571E3400]E3400 - INTEL CELERON... MegaBuy Technology Superstore (QLD) | www.megabuy.com.au | updated: 20-07-2011 $49.00Intel Celeron Dual Core E3400 2.6GHZ 800FSB LGA775 UMart Online - Sunshine Coast (QLD) | www.umart.com.au | updated: 20-07-2011 $49.00Intel Celeron E3400 Wolfdale 2.6GHz 1MB L2 Cache LGA 775 65W Dual-Core Desk... iiBuy (NSW) | www.iibuy.com.au | updated: 20-07-2011 $50.00CPU/Processor Intel S775 Celeron Dual Core E3400 (2.4GHz) IT Estate (NSW) | www.itestate.com.au | updated: 20-07-2011 $50.82Intel Dual Core Celeron E3400 CPU, 2.60GHz/800MHz FSB/1MB cache/LGA775, Dua...ARC Computers (NSW) | www.arc.com.au | updated: 20-07-2011 $51.00Intel Dual Core Cel E3400 2.6G 1Mb; Dual Core Retail Box HS&F 800Mhz FSB; L... NetPlus (WA) | www.netplus.com.au | updated: 20-07-2011 $51.00Intel Dual Core Celeron E3400 CPU 2.60 GHz 800MHz FSB 1MB cache Socket LGA7...Foxcomp Technology (WA) | www.foxcomp.com.au | updated: 20-07-2011 $51.00INTEL BX80571E3400 CELERON E3400 2.60GHz 1MB CACHE 800FSB LGA775Foxcomp Technology (WA) | www.foxcomp.com.au | updated: 20-07-2011 $51.11Intel Dual Core Celeron E3400 CPU, 2.60 GHz, 800MHz FSB, 1MB cache, Socket ...Excel Computers (NSW) | www.excelcomputers.com.au | updated: 17-07-2011 $52.75INTEL BX80571E3400 CELERON E3400/2.60GHZ/1MB CACHE/800 ...Computer Wholesale (NSW) | www.computerwholesale.com.au | updated: 15-07-2011 $52.95";
preg_match_all("/\\$[\d]+[\d\.]*/",$str,$matchs);
print_r($matchs);
?>
(
[0] => Array
(
[0] => $25.00
[1] => $39.00
[2] => $46.99
[3] => $47.00
[4] => $47.00
[5] => $48.00
[6] => $48.00
[7] => $48.00
[8] => $48.00
[9] => $48.93
[10] => $49.00
[11] => $49.00
[12] => $50.00
[13] => $50.82
[14] => $51.00
[15] => $51.00
[16] => $51.00
[17] => $51.11
[18] => $52.75
[19] => $52.95
))
print_r($matches[0]);