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
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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.