Jump to content

PHP regex help please


SnakZ

Recommended Posts

 

ok ok i suck at this and that is why i'm hear asking for help lol

 

im pulling data from SQL and only need part of it

 

this is the SQL data

Flowplayer<--->flowplayer/flowplayercode.php<---> FLV,MP4,F4V|---|HTML5<--->HTML5/html5code.php<---> MP4,WebM,Ogg|---|WMVPLAYER<--->WMVPLAYER/wmvplayercode.php<--->wmv,wma|---|JWPLAYER<--->JWPLAYER/JWPLAYERcode.php<--->mp4,mov,f4v,flv,3gp,3g2,ogv,webm,mp3,aac,m4a,ogg,wav,swf|---|VLC<--->VLC/VLCcode.php<--->|---|

 

Let say this is what im trying to grab for now

HTML5<--->HTML5/html5code.php<---> MP4,WebM,Ogg

 

the main splinter is |---| that what divides everything (in that SQL data there is 5 players )

<---> is what divides the other part of the data

 

 

this is a code i had hope would work but it didnt lol

preg_match('/'.$_GET['name'].'<--->([A-Za-z0-9\-_=]+)<--->([A-Za-z0-9\-_=]+).+?/', $playersinfo1['players'], $matches);

 

 

i would love any help one can give  ty  for ur time

Link to comment
https://forums.phpfreaks.com/topic/263290-php-regex-help-please/
Share on other sites

 

preg_match('/'.$_GET['name'].'<--->([A-Za-z0-9?\/+.]+)<--->/', $playersinfo1['players'], $matches);

 

gives me

HTML5<--->HTML5/html5code.php<--->

 

but i have yet to find a way to grab that last part i try to just re-add ([A-Za-z0-9?\/+.]+) at the end but then it can no longer find the matche

 

think i got it all worked out there was a "space" that was stopping it

add an " *" fixed it but now just need to move on for more error settings as who know what the end user would use for file path, name, or type

 

 

preg_match('/'.$_GET['name'].'<--->([A-Za-z0-9?\/+.]+)<--->([" *"A-Za-z0-9?\/+,]+)/i', $playersinfo1['players'], $matches);

 

for now i will mark this as solve if you find any errors im happy to hear them lol

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.