Results 51 to 60 of 67
-
9th Jan 2012, 10:11 AM #51Member
Thanks I understand better but i stumble a bit on preg_match command I read about it and I cant seem how people manage to get the right stuff out weird symbol that make no sense to me
PHP Code:preg_match('#\[IMG\](.*)\[\/IMG\]#', $data, $matches);
This what I don't understand much #\[IMG\](.*)\[\/IMG\]# what is all the simple telling what to search can you break it down to me explain what those do? like # is and / is and other symbol I manage to learn ^ start line and $ endline ect
-
9th Jan 2012, 11:05 AM #52Member
preg_match uses "Perl Compatible Regex library" so you have to search for Regex or regular expression in Google to find infos about it. It's a pretty powerful tool, worth to learn.
'#\[IMG\](.*)\[\/IMG\]#' is the search pattern string
# is the delimiter (it's on both sides of the string). You can use modifiers that are placed after the ending delimiter. For example '#\[IMG\](.*)\[\/IMG\]#i' for case-insensitive search (so both IMG and img match the pattern)
\[IMG\] matches the string [IMG]. You have to escape [ and ] by a backslash because normally you use those to match a character set ([a-z] matches any letter, [a-zA-z0-9_] any alphanumeric character and underscore)
. matches any character
* means 0 or more times (if it wouldnt be there, in your case, it would only match a single character, like [IMG]a[/IMG] or [IMG]1[/IMG]...). In the place of * you can also use + for one or more times or {max,min} like {2,10} for min x, max y times.
(.*) parentheses are used to capture a part of a pattern. $matches[0] will contain the whole matching string, $matches[1] the first captured part (between the first pair of parentheses), $matches[2] the second ...
\/ - here the / is also escaped, I don't really know why, I think it would work without it. It should be escaped when the delimiter is not # but /.
-
9th Jan 2012, 11:08 AM #53Member
and yeah, ^ matches starting of a line (or of the whole string, depending on modifiers), $ matches end of line/string.
-
9th Jan 2012, 07:30 PM #54Member
thank for the help another thing is there a way to test the result of curl?
-
9th Jan 2012, 07:43 PM #55MemberPHP Code:
$url='http://www.imdb.com/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$content = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
http://php.net/manual/en/function.curl-exec.php
http://php.net/manual/en/function.curl-getinfo.php
-
9th Jan 2012, 08:06 PM #56Member
thank you very much sir
-
14th Jan 2012, 04:44 AM #57OPToo busy :|Website's:
L337Fx.com BeastieBay.netNote:
It'll take me more time to fix the grabbing error from IMDb.com since I use a pre-made class and until the original owner fixes it, I cannot do much. Till now I've figured out only to fix the 'Genres' data, rest is still to be fixed. So sorry for the delay.
-
14th Jan 2012, 10:52 AM #58MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comwhat you want to fix?
-
21st Jan 2012, 08:58 PM #59MemberWebsite's:
Swagger360.comlink is down any other alternative
-
21st Jan 2012, 11:46 PM #60MemberWebsite's:
imdber.org justpaste.me^You can try this one for the mean time.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
IMDB Info Generator
By saninokia in forum Web Development AreaReplies: 20Last Post: 25th Aug 2012, 10:42 AM -
[Selling] IMDB Vbulletin Generator $15
By nseiken in forum Marketplace (Buy, Sell and Trade)Replies: 18Last Post: 27th Apr 2012, 01:07 AM -
Full Featured IMDB Generator
By JamesVaporH in forum Web Development AreaReplies: 0Last Post: 21st Mar 2012, 09:12 PM -
vBulletin IMDB Info Generator
By JMaldo in forum Completed TransactionsReplies: 31Last Post: 30th Nov 2009, 09:05 AM
themaCreator - create posts from...
Version 3.45 released. Open older version (or...