Jump to content

php preg_match problem


fareforce

Recommended Posts

I am having problems with a preg_match. The bit of code I need to match up is:
[code]document.images['picture'].src = "images/" + Views[View] + "3.png";[/code]

The code I tried is, but it didn't work:
[code]preg_match("|src = \"images/\" + Views[View] + \"(.*).png\"|Uis",get_put($url_aurora),$aurora);[/code]

I am not very good with php code so I am sure I messed something up. Can anyone help me? Another line of code I could pull this from would be:
[code]document.write ('3.png" border="0">');[/code]


Any help would be greatly appriciated!  =)
Link to comment
https://forums.phpfreaks.com/topic/21234-php-preg_match-problem/
Share on other sites

Ok. I tried using:
[code]preg_match("|src = \"images/\" \+ Views\[View\] \+ \"(.*)\.png\"|Uis",get_put($url_aurora),$aurora);[/code]
but it still isn't working.

I guess I should also add the 3 (in the above example) is the variable I am pulling. It can range from 0-10.
Link to comment
https://forums.phpfreaks.com/topic/21234-php-preg_match-problem/#findComment-94903
Share on other sites

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.