Jump to content

Preg_match_all a little fix


mysterbx

Recommended Posts

Hello,

I have this code, it should search for passwords:

 

preg_match_all("#([\n\s])((Password(\:|)|pw\:|Pass(\:|))[\s\n\r\t\S<][^\n\t\r]*)#ise", $fix, $pass);

 

it find's the passwords, but shows it like this:

Password somekindaword
pass: somekindaword2

 

but it should look like this:

somekindaword, somekindaword2

 

please help me, its the last component...

Link to comment
Share on other sites

well, then if no one knows that ...

 

how can I show the text below in preg_match

","(.*)","

 

something like this like this:

 

$googleimagesbody = '","http://imageurl.goeshere.com/image.jpg","';

preg_match("#","http://(.*)","#", $googleimagesbody, $imagefromgoogle);

 

Output: imageurl.goeshere.com/image.jpg

 

this should be easier than the one above...

 

plz help me....

Link to comment
Share on other sites

it should only return image's url from images.google.com (only one url)

 

sth like this:

$document = preg_match('#http:\/\/(.*)\"\,\"#',$document,$image);
print_r($image);

 

and the $document:

<html><head><meta http-equiv=content-type content="text/html; charset=UTF-8"><title>crysis - Google vaizdų paieška</title><style><!--
.ts td,.tc{padding:0}.ts,.tb{border-collapse:collapse}div,td{color:#000}
.f{color:#666}
.flc,.fl:link{color:#77c}
a:link,.w,a.w:link,.w a:link,.q:visited,.q:link,.q:active,.q{color:#00c}
a:visited,.fl:visited{color:#551a8b}
a:active,.fl:active{color:red}
.t{background:#e5ecf9;color:#000}
.bb{border-bottom:1px solid #36c}
.bt{border-top:1px solid #36c}
.j{width:34em}
.h{color:#36c}
.i,.i:link{color:#a90a08}
.a,.a:link{color:green}
.z{display:none}
div.n{margin-top:1ex}
.n a{font-size:10pt;color:#000}
.n .i{font-size:10pt;font-weight:bold}
.b a{font-size:12pt;color:#00c;font-weight:bold}
#np,#nn,.nr,#logo span,.ch{cursor:pointer;cursor:hand}
.ta{padding:3px 3px 3px 5px}#tpa2,#tpa3{padding-top:9px}#gbar{float:left;font-weight:bold;height:22px;padding-left:2px}.gbh,.gb2 div{border-top:1px solid #c9d7f1;font-size:0;height:0}.gbh{position:absolute;top:24px;width:100%}.gb2 div{margin:5px}#gbi{background:#fff;border:1px solid;border-color:#c9d7f1 #36c #36c #a2bae7;top:24px;z-index:1000}#guser{padding-bottom:7px !important}#gbar,#guser{font-size:13px;padding-top:1px !important}@media all{.gb1,.gb3{height:22px;margin-right:.73em;vertical-align:top}}#gbi,.gb2{left:0;position:absolute;visibility:hidden}.gb2{z-index:1001}#gbar a,#gbar a:active,#gbar a:visited{color:#00c;font-weight:normal}.gb2 a,.gb3 a{text-decoration:none}.gb2 a{display:block;padding:.2em .5em}#gbar .gb2 a:hover{background:#36c;color:#fff}.sl,.r{font-weight:normal;margin:0;display:inline}
.sl{font-size:84%}
.r{font-size:100%}
.csb,#navbar div,#logo span{background:url(/images/nav_logo3.png) no-repeat;overflow:hidden;height:26px}
#navbar .nr{background-position:-60px 0;width:16px}
#navbar #np{width:44px}
#navbar #nf{background-position:-26px 0;width:18px}
#navbar #nc{background-position:-44px 0;width:16px}
#navbar #nn{background-position:-76px 0;width:66px;margin-right:34px}
#navbar #nl{background-position:-76px 0;width:46px}
#logo{display:block;width:150px;height:52px;position:relative;overflow:hidden;margin:15px 0 12px}
#logo span{background-position:0 -26px;position:absolute;top:0;left:0;width:100%;height:100%}
.ss{background:url(/images/nav_logo3.png) no-repeat;overflow:hidden;display:block;background-position:0 -87px;position:absolute;left:0;top:0}.cps{overflow:hidden;height:18px;width:114px}body,td,div,.p,a{font-family:arial,sans-serif}
#sd{font-size:113%;font-weight:bold}
#ap{font-size:64%}
--></style>
<script>window.google={kEI:"wNSdR-uqI43o-gLCzIzDBw",kEXPI:"0",kHL:"lt"};
function g(c){var d="undefined",a="1";if(c&&c.getElementById)if(typeof XMLHttpRequest!=d)a="2";else if(typeof ActiveXObject!=d){var b,e,f="MSXML2.XMLHTTP",h=[f+".6.0",f+".3.0",f,"Microsoft.XMLHTTP"];for(b=0,e;e=h[b++];)try{new ActiveXObject(e);a="2"}catch(i){}}return a};window.maybeRedirectForGBV=function(c,d,a){var b=g(c);if(b!=a)d.href="http://images.google.lt/images?hl=lt&q=crysis&btnG=Ie%C5%A1koti+paveiksl%C4%97li%C5%B3&ei=wNSdR-uqI43o-gLCzIzDBw&gbv="+b};
maybeRedirectForGBV(document,location,"2");window._isr_load=function(a){var b=a.options[a.selectedIndex].value;if(b){location.href=b}return false};
window.clk=function(b,c,d,e,f,g){if(document.images){var a=encodeURIComponent||escape;(new Image).src="/url?sa=T"+(c?"&oi="+a(c):"")+(d?"&cad="+a(d):"")+"&ct="+a(e)+"&cd="+a(f)+(b?"&url="+a(b.replace(/#.*/,"")).replace(/\+/g,"%2B"):"")+"&ei=wNSdR-uqI43o-gLCzIzDBw"+g}return true};
window.gbar={};(function(){;var a=window.gbar,b,h,j,k="visible";function q(d,g,f){d.visibility=d.visibility==k?"hidden":k;d.left=g+"px".top=f+"px"}a.tg=function(d){var g=0,f,c,l,m,e=0,i=0,n=window.navExtra;!h&&(h=document.getElementById("gbar"));!j&&(j=h.getElementsByTagName("span"));(d||window.event).cancelBubble=true;if(!b){b=document.createElement(Array.every||window.createPopup?"iframe":"div");b.frameBorder="0";b.id="gbi";b.scrolling="no";b.src="#";document.body.appendChild(b);if(n&&j[8])for(var r in n){var o=document.createElement("span");o.appendChild(n[r]);o.className="gb2";j[0].parentNode.insertBefore(o,j[8])}document.onclick=a.close}for(;j[e];e++){c=j[e];l=c.className;m=c.firstChild.tagName;if(l=="gb3"){f=c.offsetLeft;while(c=c.offsetParent)f+=c.offsetLeft}else if(l=="gb2"){q(c.style,f+1,25+g);i=Math.max(i,m=="A"&&c.offsetWidth);g+=m=="DIV"?9:20}}for(e=0;j[e];e++){if(j[e].className=="gb2"){j[e].style.width=i+"px"}}var p=b.style;p.height=g+"px";p.width=i+"px";q(p,f,24)};a.close=function(d){b&&b.style.visibility==k&&a.tg(d)};})();</script></head><body bgcolor=#ffffff topmargin=3 marginheight=3 ><noscript><meta HTTP-EQUIV="refresh" content="0;url=http://images.google.lt/images?hl=lt&q=crysis&btnG=Ie%C5%A1koti+paveiksl%C4%97li%C5%B3&gbv=1&ei=wNSdR-uqI43o-gLCzIzDBw"><style><!--
table,div,span,font,p{display:none}
--></style>
<div style="display:block">Jei per kelias sekundes nebūsite nukreipti, paspauskite <a href="http://images.google.lt/images?hl=lt&q=crysis&btnG=Ie%C5%A1koti+paveiksl%C4%97li%C5%B3&gbv=1">čia</a>.</div></noscript><div id=gbar><nobr><span class=gb1><a href="http://www.google.lt/search?hl=lt&q=crysis&gbv=2&ie=UTF-8&sa=N&tab=iw">Žiniatinklis</a></span> <span class=gb1>Vaizdai</a></span> <span class=gb1><a href="http://groups.google.lt/groups?hl=lt&q=crysis&gbv=2&ie=UTF-8&sa=N&tab=ig">Grupės</a></span> <span class=gb1><a href="http://www.google.lt/search?hl=lt&q=crysis&gbv=2&ie=UTF-8&cat=gwd/Top&sa=N&tab=id">Katalogas</a></span> <span class=gb1><a href="http://www.google.com/calendar/render?ie=UTF-8&sa=N&tab=ic">Kalendorius</a></span> <span class=gb1><a href="http://mail.google.com/mail/?ie=UTF-8&sa=N&tab=im">„Gmail“</a></span> <span class=gb1><a href="http://picasaweb.google.lt/lh/searchbrowse?hl=lt&q=crysis&gbv=2&ie=UTF-8&sa=N&tab=iq">Nuotraukos</a></span> </nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div><table class=tb style=clear:left width=100%><tr><form name=gs method=GET action="/images"><td class=tc valign=top><a id=logo href="http://www.google.lt/webhp?hl=lt" title="Į pradinį Google puslapį">Google<span></span></a></td><td style="padding:0 0 7px;padding-left:8px" valign=top width=100%><table class=tb style="margin-top:25px"><tr><td class=tc nowrap><input type=hidden name=gbv value="2"><input type=hidden name=svnum value=10><input type=hidden name=hl value="lt"><input type=text name=q size=41 maxlength=2048 value="crysis" title="Ieškoti paveikslėlių"> <input type=submit name="btnG" value="Ieškoti paveikslėlių"> <input type=submit name="btnmeta=search=search" value="Ieškoti Žiniatinklis"></td><td class=tc nowrap width=100%><span id=ap>  <a href="/advanced_image_search?q=crysis&gbv=2&svnum=10&hl=lt">Išplėstinė vaizdų paieška</a><br>  <a href="/preferences?q=crysis&gbv=2&hl=lt">Nuostatos</a></span></td></tr></table></td></tr></form></table><table border=0 cellpadding=0 cellspacing=0 width=100% class="t bt"><tr><td nowrap><span id=sd> Vaizdai </span><font size=-1> Rodoma:  </font></td><td width=98%><form style="margin:0"><select name=imagesize onchange="_isr_load(this)" style="margin:2px 0"><option value="" selected>Visų dydžių vaizdai<option value="/images?q=crysis&gbv=2&svnum=10&hl=lt&sa=G&imgsz=huge">Labai dideli paveikslėliai<option value="/images?q=crysis&gbv=2&svnum=10&hl=lt&sa=G&imgsz=xxlarge">Dideli vaizdai<option value="/images?q=crysis&gbv=2&svnum=10&hl=lt&sa=G&imgsz=small|medium|large|xlarge">Vidutinio dydžio vaizdai<option value="/images?q=crysis&gbv=2&svnum=10&hl=lt&sa=G&imgsz=icon">Maži vaizdai</select></form></td><td align=right nowrap id=resultStats><font size=-1>Rezultatai nuo <b><span id=lowerLimit>1</span></b> iki <b><span id=upperLimit>21</span></b> iš maždaug <b><span id=maxLimit>888.000</span></b> užklausai <b>crysis</b>.  (<b>0,04</b> sekundės) </font></table><div><br><div id=ImgContent></div><script><!--
window.dyn = {};(function() {function i(a,c,d){var b="on"+c;if(a.addEventListener){a.addEventListener(c,d,false)}else if(a.attachEvent){a.attachEvent(b,d)}else{var e=a[b];a[b]=function(){var g=e.apply(this,arguments),h=d.apply(this,arguments);return g==undefined?h:(h==undefined?g:h&&g)}}};var j=window.dyn,l="tDataImage",m=[],o=0,q="",r="",s="",t=0;j.shouldShowAllImages=false;j.showBigFont=false;var u=3;window.onresize=v;function w(a,c,d,b){q=a;r=c;s=d;t=parseInt(b,10);i(window,"load",x);var e=y();z(e)}function x(){var a=A("navbar");if(a&&a.getElementsByTagName){var c=a.getElementsByTagName("a");for(var d=0;d<c.length;d++){c[d].onclick=function(){return B(this)}}}}function y(){if(document&&document.body&&document.body.clientWidth){return document.body.clientWidth}else{return window.innerWidth}}
function C(){if(document&&document.body&&document.body.clientHeight){return document.body.clientHeight}else{return window.innerHeight}}function D(a){return Math.ceil(17/a)*a}function z(a){var c=0;u=E(a);var d=j.shouldShowAllImages?21:D(u),b=Math.ceil(d/u),e="<table width=100% cellspacing=0 cellpadding=0 border=0>";for(var g=0;g<b;g++){var h="<tr>",k="<tr>";for(var n=0;n<u;n++){h+="<td id="+l+c+" align=center nowrap valign=bottom width="+100/u+"%></td>";k+="<td id=tDataText"+c+" align=center valign=top width="+
100/u+"%></td>";c++}h+="</tr>";k+="</tr>";e+=h+k}e+="</table>";A("ImgContent").innerHTML=e}function F(){var a=D(u);G(a);H(a)}function G(a){var c=t,d=parseInt(A("upperLimit").innerHTML,10);if(c<0){return}if(!isNaN(d)&&c>=d){return}var b=j.shouldShowAllImages?m.length:a;if(m.length<b){b=m.length}b=c+b;A("lowerLimit").innerHTML=c+1;A("upperLimit").innerHTML=b}function E(a){var c=0;if(!a){c=4}else if(a<=I(690)){c=3}else if(a<I(800)){c=4}else{c=Math.max(Math.floor(a/I(200)),3)}return c>7?7:c}function I(a){var c;
if(c=document.createElement("div")){c.style.width="10em";document.body.appendChild(c);var d=c.offsetWidth/10;document.body.removeChild(c);return d?Math.ceil(12.5*d*a/200):a}return a}function H(a){(new Image).src="/gen_204?bw="+y()+"&bh="+C()+"&ncols="+u+"&nimg="+a+"&atyp=i"}function v(){var a=y();if(E(a)!=u){z(a);var c=D(u);G(c);if(j.shouldShowAllImages){c=m.length}for(var d=0;d<c;d++){J(d)}}}function K(a,c,d,b,e,g,h,k,n,p,M,N,O,P,Q,R){var f=new Image;f.p=a;f.o=c;f.d=d;f.b=b;f.c=e;f.a=g;f.h=h;f.g=
k;f.j=n;f.n=p;f.i=M;f.l=N;f.f=O;f.e=P;f.k=Q;f.m=R;m[o]=f;var S=D(u);if(o<S||j.shouldShowAllImages){J(o)}o++}function J(a){var c="",d="";if(a>=m.length){return}var b=m[a];A(l+a).style.paddingTop=a<u?"0px":"20px";var e="/imgres?imgurl="+(b.b.indexOf("://")<0?"http://":"")+b.b+"&imgrefurl="+b.p+"&tbnid="+b.d+"&tbnh="+b.a+"&tbnw="+b.c+s+"&prev="+r;c+="<a href="+e+b.o+"><img style='border:1px solid;' src="+b.k+"?q=tbn:"+b.d+(b.m=="1"?b.b:"");if(b.c!=""&&b.a!=""){c+=" width="+b.c+" height="+b.a}c+="></a>";
A(l+a).innerHTML=c;d+="<font face=arial,sans-serif size=-1>";if(j.showBigFont){d+="<font size=3>"+b.h+"</font>"}else{d+=b.h}if(b.j!=""){d+="<span class=m>";if(b.g!=""){d+=" <font dir=ltr>- "+b.g+"</font>"}d+=" <font dir=ltr>- "+b.j+"</font></span>"}d+="<br>"+b.n+(b.i?" - "+b.i:"")+"<br><font color="+q+">"+b.l+"</font>";if(b.f!=""&&b.e!=""){d+="<br>[ <a class=fl href='"+b.f+"'>"+b.e+"</a> ]"}d+="</font>";A("tDataText"+a).innerHTML=d}function B(a){var c=document.location,d=a.href,
b,e=0,g=D(u);b=t<0?0:t;var h=false,k=a.getElementsByTagName("div");if(k&&k.length>0){h=k[0]}if(a.innerHTML.search("nav_next.gif")!=-1||h&&h.id=="nn"){e=b+g}else if(a.innerHTML.search("nav_previous.gif")!=-1||h&&h.id=="np"){e=b-g;if(e<=0){e=0}}else{var n=/(\d+)\s*$/,p=n.exec(a.innerHTML);if(p&&p[1]){e=p[1]*1*g-g}}d=L(d,"start",e)=L(d,"ndsp",g);c.href=d;return false}function L(a,c,d){var b=new RegExp("[?&]"+c+"=([^&]*)","i"),e=b.exec(a);if(e&&e.length>1){var g=e[0].charAt(0)+c+"="+d;a=a.replace(b,
g)}else{a+="&"+c+"="+d}return a}function A(a){return document.getElementById(a)}j.initialize=w;j.updateStatus=F;j.Img=K;
}) ();dyn.initialize("#008000", "/images%3Fq%3Dcrysis%26gbv%3D2%26svnum%3D10%26hl%3Dlt%26sa%3DG","", "0");dyn.Img("http://www.clubic.com/forum/jeux-video-pc/crysis-le-jeu-phare-de-2007-par-ea-crytek-le-jeu-sort-le-16-novembre-id275862-page1.html&h=485&w=800&sz=117&hl=lt&start=1","","9_fpqmq8VYEgYM:","http://www.purepc.pl/files/Image/aktualnosci_lipiec_2006/crysis.jpg","143","87","\x3cb\x3e...\x3c/b\x3e entre la vraie vie et \x3cb\x3ecrysis\x3c/b\x3e :","","","800 x 485 - 117k","jpg","www.clubic.com","","","http://tbn0.google.com/images","1");dyn.Img("http://squallleonhart8.wordpress.com/2008/01/20/los-rumores-de-que-crysis-vea-la-luz-en-playstation-3-son-cada-vez-mayores/&h=1125&w=1500&sz=294&hl=lt&start=2","","4qGVBgQptaXHKM:","http://chrisevans3d.com/images/crysis_high_res/crysis8.jpg","150","113","(Así luce \x3cb\x3eCrysis\x3c/b\x3e en PC al máximo \x3cb\x3e...\x3c/b\x3e","","","1500 x 1125 - 294k","jpg","squallleonhart8.wordpress.com","","","http://tbn0.google.com/images","1");dyn.Img("http://www.clubic.com/forum/jeux-video-pc/crysis-le-jeu-phare-de-2007-par-ea-crytek-le-jeu-sort-le-16-novembre-id275862-page1.html&h=700&w=960&sz=134&hl=lt&start=3","","JqGiEEqu7EsjVM:","http://www.crysis-games.de/crysis.jpg","148","108","\x3cb\x3eCrysis\x3c/b\x3e est un FPS revolutionnaire \x3cb\x3e...\x3c/b\x3e","","","960 x 700 - 134k","jpg","www.clubic.com","","","http://tbn0.google.com/images","1");dyn.Img("http://rpgamerz.wordpress.com/2007/11/13/crysis-pa-pc-en-torrent/&h=1339&w=2046&sz=344&hl=lt&start=4","","mLnvBMnRU0XsKM:","http://www.inbox.net.mk/wp-content/2006/10/crysis.jpg","150","98","\x3cb\x3eCrysis\x3c/b\x3e pa pc en torrent","","","2046 x 1339 - 344k","jpg","rpgamerz.wordpress.com","","","http://tbn0.google.com/images","1");dyn.Img("http://hackhell.com/showthread.php%3Ft%3D374007&h=737&w=520&sz=201&hl=lt&start=5","","FkiZuxSr36BF-M:","http://crysis.daddeldepot.net/images_gemischt/news/CrysisPackshot1.jpg","99","141","\x3cb\x3eCrysis\x3c/b\x3e (PC)","","","520 x 737 - 201k","jpg","hackhell.com","","","http://tbn0.google.com/images","1");dyn.Img("http://www.geimeris.com/%3Fp%3D365&h=340&w=500&sz=35&hl=lt&start=6","","BNgZC2SIERFpSM:","http://www.geimeris.com/wp-content/images/crysis_later.jpg","130","88","\x3cb\x3eCrysis\x3c/b\x3e Pirmą kartą nuo to, \x3cb\x3e...\x3c/b\x3e","","","500 x 340 - 35k","jpg","www.geimeris.com","","","http://tbn0.google.com/images","1");dyn.Img("http://www.trplaystation.com/%3Fp%3D8&h=302&w=450&sz=47&hl=lt&start=7","","9nc3d9lDG3UCNM:","http://www.stanza101.com/101blog_images/crysis2.jpg","127","85","\x3cb\x3e...\x3c/b\x3e \x3cb\x3eCrysis\x3c/b\x3e’i sessiz sedasız oynamayı \x3cb\x3e...\x3c/b\x3e","","","450 x 302 - 47k","jpg","www.trplaystation.com","","","http://tbn0.google.com/images","1");dyn.Img("http://www.catchgamer.no/index.php%3Fmodule%3Dblogs%26f%3Dread%26blogId%3D1104&h=728&w=1280&sz=168&hl=lt&start=8","","tXNH1qebOqZumM:","http://www.ps3land.com/previews/Crysis/crysis_6_big%255B1%255D.jpg","150","85","Skjermbilde fra \x3cb\x3eCrysis\x3c/b\x3e","","","1280 x 728 - 168k","jpg","www.catchgamer.no","","","http://tbn0.google.com/images","1");dyn.Img("http://mundothus.blogspot.com/2008/01/realismo-crysis.html&h=972&w=1280&sz=382&hl=lt&start=9","","AlkNI9D8VUCLxM:","http://static.computergames.ro/cg/assassin/images2/crysis/crysis067.jpg","150","114","\x3cb\x3eCrysis\x3c/b\x3e","","","1280 x 972 - 382k","jpg","mundothus.blogspot.com","","","http://tbn0.google.com/images","1");dyn.Img("http://www.crysisdemo.com/crysis-system-requirements.htm&h=1136&w=1664&sz=248&hl=lt&start=10","","ADftSsilGyQ__M:","http://www.crysisdemo.com/crysis-demo-download/crysis-system-requirements-ea-store.jpg","150","102","\x3cb\x3eCrysis\x3c/b\x3e System Requirements - \x3cb\x3e...\x3c/b\x3e","","","1664 x 1136 - 248k","jpg","www.crysisdemo.com","","","http://tbn0.google.com/images","1");dyn.Img("http://nkm.balsas.lt/naujiena_spausdinimui/%3Fnews_id%3D240079%26action%3Dview&h=313&w=500&sz=36&hl=lt&start=11","","xm9MFGeZE5D_cM:","http://nkm.balsas.lt/files/images/Crysis.jpg","130","81","\x3cb\x3eCrysis\x3c/b\x3e","","","500 x 313 - 36k","jpg","nkm.balsas.lt","","","http://tbn0.google.com/images","1");dyn.Img("http://nkm.balsas.lt/naujiena_spausdinimui/%3Fnews_id%3D240079%26action%3Dview&h=313&w=500&sz=37&hl=lt&start=12","","22UwvYFTLBdHnM:","http://nkm.balsas.lt/files/images/Crysis-2.jpg","130","81","\x3cb\x3eCrysis\x3c/b\x3e. ve3d.ign.com.","","","500 x 313 - 37k","jpg","nkm.balsas.lt","","","http://tbn0.google.com/images","1");dyn.Img("http://mostwantedgamesof07.blogspot.com/2007/12/top-10-most-wanted-pc-games.html&h=720&w=1278&sz=245&hl=lt&start=13","","pDYQwjSPfu7_lM:","http://www.hardwired.hu/img/wg/2/743/Crysis_44.jpg","150","85","\x3cb\x3eCrysis\x3c/b\x3e is probably the best shooter \x3cb\x3e...\x3c/b\x3e","","","1278 x 720 - 245k","jpg","mostwantedgamesof07.blogspot.com","","","http://tbn0.google.com/images","1");dyn.Img("http://www.rotpod.net/rotpod/%3Fcat%3D299&h=1200&w=1920&sz=170&hl=lt&start=14","","DN3G7Feqrc8xVM:","http://www.rotpod.net/rotpod/wp-content/uploads/2007/10/crysis-wallpaper-alien-blast-1.jpg","150","94","\x3cb\x3eCrysis\x3c/b\x3e is probably the best-looking \x3cb\x3e...\x3c/b\x3e","","","1920 x 1200 - 170k","jpg","www.rotpod.net","","","http://tbn0.google.com/images","1");dyn.Img("http://www.vpd.fi/product_catalog.php%3Fmc%3D46&h=381&w=270&sz=30&hl=lt&start=15","","rSyGqbtD9Rhk3M:","http://www.vpd.fi/kuvat/pc_crysis_kansi_pegi.jpg","87","123","\x3cb\x3eCrysis\x3c/b\x3e PC (DVD \x3cb\x3e...\x3c/b\x3e","","","270 x 381 - 30k","jpg","www.vpd.fi","","","http://tbn0.google.com/images","1");dyn.Img("http://nettosonic.wordpress.com/tag/games/&h=1080&w=1918&sz=629&hl=lt&start=16","","vvF2J1DKozs6JM:","http://ve3dmedia.ign.com/ve3d/image/article/745/745255/new-crysis-dx10-screenshot-20061110001326035.jpg","150","84","\x3cb\x3eCRYSIS\x3c/b\x3e. A história, apesar de não \x3cb\x3e...\x3c/b\x3e","","","1918 x 1080 - 629k","","nettosonic.wordpress.com","","","http://tbn0.google.com/images","1");dyn.Img("http://www.gamespot.com/forums/show_msgs.php%3Fboard_id%3D314159282%26topic_id%3D26063213&h=727&w=1278&sz=181&hl=lt&start=17","","6KpNOkNMXCW7-M:","http://scr3.golem.de/screenshots/0603/crytek-crysis/crysis_05.jpg","150","85","\x3cb\x3eCrysis\x3c/b\x3e. Edited on Nov 24, \x3cb\x3e...\x3c/b\x3e","","","1278 x 727 - 181k","jpg","www.gamespot.com","","","http://tbn0.google.com/images","1");dyn.Img("http://www.hexus.net/content/item.php%3Fitem%3D5356&h=310&w=550&sz=82&hl=lt&start=18","","vVKVDHGXmgjCwM:","http://img.hexus.net/v2/gaming/screenshots/crysis/crysis21_small.jpg","133","75","\x3cb\x3eCrysis\x3c/b\x3e new screenshots","","","550 x 310 - 82k","jpg","www.hexus.net","","","http://tbn0.google.com/images","1");dyn.Img("http://www.gamestar.hu/crysis-patch-csak-januarban.html&h=768&w=1024&sz=570&hl=lt&start=19","","5Z_SAZhf1X17vM:","http://www.gamestar.hu/apix/0710/crysis.jpg","150","113","\x3cb\x3ecrysis\x3c/b\x3e.jpg","","","1024 x 768 - 570k","jpg","www.gamestar.hu","","","http://tbn0.google.com/images","1");dyn.Img("http://forum.lrytas.lt/topic_show.pl%3Fdid%3D%3Btid%3D114783%3Bpg%3D2&h=753&w=679&sz=42&hl=lt&start=20","","nUwNlBKyx8RErM:","http://img82.imageshack.us/img82/5930/crysis200603290022123615ij.jpg","128","142","http://maxygames.no.sapo.pt/\x3cb\x3eCrysis\x3c/b\x3e. \x3cb\x3e...\x3c/b\x3e","","","679 x 753 - 42k","jpg","img82.imageshack.us","","","http://tbn0.google.com/images","1");dyn.Img("http://sosyalmekan.wordpress.com/2007/05/26/crysis-compex-ve-giresun/&h=819&w=1024&sz=637&hl=lt&start=21","","G7Znxmh0_djo3M:","http://crysis.daddeldepot.net/images_gemischt/crysis_wallpaper/CRYSIS_WP7_1024x768.jpg","150","120","\x3cb\x3e...\x3c/b\x3e \x3cb\x3ecrysis\x3c/b\x3e Compex de tanıtılacak… \x3cb\x3e...\x3c/b\x3e","","","1024 x 819 - 637k","jpg","sosyalmekan.wordpress.com","","","http://tbn0.google.com/images","1");dyn.updateStatus();//-->

</script><br clear=all><div id=navbar class=n><table border=0 cellpadding=0 width=1% cellspacing=0 align=center><tr align=center style=text-align:center valign=top><td nowrap><div id=nf></div><td nowrap><div id=nc></div><span class=i>1</span><td nowrap><a href="/images?q=crysis&gbv=2&svnum=10&hl=lt&start=21&sa=N"><div class=nr></div>2</a><td nowrap><a href="/images?q=crysis&gbv=2&svnum=10&hl=lt&start=42&sa=N"><div class=nr></div>3</a><td nowrap><a href="/images?q=crysis&gbv=2&svnum=10&hl=lt&start=63&sa=N"><div class=nr></div>4</a><td nowrap><a href="/images?q=crysis&gbv=2&svnum=10&hl=lt&start=84&sa=N"><div class=nr></div>5</a><td nowrap><a href="/images?q=crysis&gbv=2&svnum=10&hl=lt&start=105&sa=N"><div class=nr></div>6</a><td nowrap><a href="/images?q=crysis&gbv=2&svnum=10&hl=lt&start=126&sa=N"><div class=nr></div>7</a><td nowrap><a href="/images?q=crysis&gbv=2&svnum=10&hl=lt&start=147&sa=N"><div class=nr></div>8</a><td nowrap><a href="/images?q=crysis&gbv=2&svnum=10&hl=lt&start=168&sa=N"><div class=nr></div>9</a><td nowrap><a href="/images?q=crysis&gbv=2&svnum=10&hl=lt&start=189&sa=N"><div class=nr></div>10</a><td nowrap class=b><a href="/images?q=crysis&gbv=2&svnum=10&hl=lt&start=21&sa=N"><div id=nn></div>Kitas</a></table></div></div><center>
<br clear=all><br><table border=0 cellpadding=0 cellspacing=0 width=100% class="ft t bb bt"><tr><td align=center> <br><table border=0 cellpadding=0 cellspacing=0 align=center><form method=GET action=/images><tr><td nowrap>
<font size=-1><input type=text name=q size=31 maxlength=2048 value="crysis" title=""> <input type=submit name="btnG" value="Ieškoti paveikslėlių"> <input type=submit name="btnmeta=search=search" value="Ieškoti Žiniatinklis"><input type=hidden name=gbv value="2"><input type=hidden name=svnum value=10><input type=hidden name=hl value="lt"></font></td></tr></form></table><br></td></tr></table></center><center><p><hr class=z><div style=padding:2px class=""><font size=-1>©2008 Google - <a href="http://www.google.lt/">Pradžios Google tinklalapis</a> - <a href="http://adwords.google.com/select?hl=lt">Reklamavimosi programa</a> - <a href="http://www.google.lt/intl/lt/about.html">Viskas apie Google</a></font></div><br></center></body></html>

Link to comment
Share on other sites

<?php

 

// input  : ","http://imageurl.goeshere.com/image.jpg","

// output : imageurl.goeshere.com/image.jpg

 

$googleimagesbody = '","http://imageurl.goeshere.com/image.jpg","';

print "$googleimagesbody\n";

 

$imagefromgoogle = preg_replace('/\#|(http:\/\/)|\,|\"/','',$googleimagesbody);

print "$imagefromgoogle\n";

 

?>

 

Link to comment
Share on other sites

what about his:

 

<?php 
function bximagecrawl($name) {
$url = "http://images.google.com/images?hl=en&q=$name&btnG=BX&gbv=2";
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_PORT, 80);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
$document = curl_exec($ch);
print_r($image);
}
echo bximagecrawl($name);
?>

 

it should use preg_match...

the code you have given doesnt work :(

Link to comment
Share on other sites

not sure wd this.....hehehe

 

<?php

 

function bximagecrawl($name) {

    $url = "http://images.google.com/images?hl=en&q=$name&btnG=BX&gbv=2";

    $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url);

    curl_setopt($ch, CURLOPT_FAILONERROR, 1);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

    curl_setopt($ch, CURLOPT_PORT, 80);

    curl_setopt($ch, CURLOPT_TIMEOUT, 5);

    curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);

    $document = curl_exec($ch);

    $images = array();

    $images = explode('href="http://', $document);

    array_shift($images);

    foreach($images as $key => $value) {

        $tokens = preg_split('/\>|\"| /', $value);

        $images[$key] = "http://".$tokens[0];

    }

    return $images;

}

$name = 'danielradcliff';

$images = bximagecrawl($name);

print_r($images);

 

?>

 

Link to comment
Share on other sites

try this one......

 

<?php

 

function bximagecrawl($name) {

    $url = "http://images.google.com/images?hl=en&q=$name&btnG=BX&gbv=2";

    $user_agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url);

    curl_setopt($ch, CURLOPT_FAILONERROR, 1);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

    curl_setopt($ch, CURLOPT_PORT, 80);

    curl_setopt($ch, CURLOPT_TIMEOUT, 5);

    curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);

    $document = curl_exec($ch);

    $images = array();

    $images = explode('img src=http://', $document);

    array_shift($images);

    foreach($images as $key => $value) {

        $tokens = preg_split('/\>|\"| /', $value);

        $images[$key] = "http://".$tokens[0];

    }

    return $images;

}

$name = 'danielradcliff';

$images = bximagecrawl($name);

print_r($images);

 

?>

 

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.