3007 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+7 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.
2028 posts
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Provided great feedback to improve the user experience on Envato Market
  • Interviewed on an Envato blog
+9 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

2028 posts
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
  • Provided great feedback to improve the user experience on Envato Market
  • Interviewed on an Envato blog
+9 more
revaxarts says

the third array should be the port

the 6th should be the query string

3007 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+7 more
duotive says

thanks.

3445 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark 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
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Located in Canada
  • Has collected more than 1000 items on Envato Market
chrismccoy says

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

should work for just the img/

by
by
by
by
by
by