3007 posts
  • Author had a File in an Envato Bundle
  • Bought between 1 and 9 items
  • Elite Author
  • Europe
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 100 and 199 users
+2 more
duotive says
Wierd outcome…..
Array ( [0] => Array ( [0] => http://www.example.com/images/image1.jpg [1] => http://www.example.com/images/image2.jpg [2] => http://www.example.com/images/image3.jpg [3] => http://example.com/images/image4.jpg ) [1] => Array ( [0] => www.example.com [1] => www.example.com [2] => www.example.com [3] => example.com ) [2] => Array ( [0] => [1] => [2] => [3] => ) [3] => Array ( [0] => /images/image1.jpg [1] => /images/image2.jpg [2] => /images/image3.jpg [3] => /images/image4.jpg ) [4] => Array ( [0] => images/image1.jpg [1] => images/image2.jpg [2] => images/image3.jpg [3] => images/image4.jpg ) [5] => Array ( [0] => [1] => [2] => [3] => ) ) 
The problem is that this will be used for shortcodes… and lovely wordpress adds extra characters that we do not need…. that is why i was looking for regular expressions. If i only knew them…. but i find them wierd… lots of text that dose something…. never understood them.
2024 posts
  • Elite Author
  • Author had a Free File of the Month
  • Has been a member for 4-5 years
  • Austria
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Envato Studio (Microlancer) Beta Tester
+3 more
revaxarts says

looks weird but isn’t ;)

  1. first array is an array all your urls (what you need)
  2. second array is an array with just the domains
  3. fourth array is an array with the paths
all arrays representing the content within the brackets:
          2st        3nd   5th4rd      6th
https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?

the first array is the whole pattern

2024 posts
  • Elite Author
  • Author had a Free File of the Month
  • Has been a member for 4-5 years
  • Austria
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Envato Studio (Microlancer) Beta Tester
+3 more
revaxarts says

the third array should be the port

the 6th should be the query string

3007 posts
  • Author had a File in an Envato Bundle
  • Bought between 1 and 9 items
  • Elite Author
  • Europe
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 100 and 199 users
+2 more
duotive says

thanks.

3418 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 100 and 499 items
  • Referred more than 2000 users
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
+4 more
sevenspark Volunteer moderator says


Can’t you just use the explode() function?
$urls = explode("\n", $url_str);
=)))) too simple to work but it did =)))) if anyone knows a regular than can do this it will be amazing, but in the time being this is very good. THANKS !!

No problem – glad it gets you going for the time being at least :)

701 posts
  • Bought between 1000 and 4999 items
  • Canada
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
chrismccoy says

thanks.
/<img.*?src="(.*?)".*?(/>|)/gi

should work for just the img/

by
by
by
by
by
by