Jump to content

Preg_Match an array


strategos

Recommended Posts

Hello, I am a bit confused on the preg_match subject.

 

here is a snippet where I use the preg_match func:

 

<?php 
foreach ($bans as $ban){

$curbans = $ban["user_steamid"];

if(isset($_POST['submit2'])) {
$_SESSION['isbanned'] = preg_match('/'.$_SESSION['inputid'].'/i', $curbans)
}
};
?>

 

 

The array, $curbans, looks like this

 

STEAM_0:1:25941882STEAM_0:1:37863673STEAM_0:0:49096012STEAM_0:0:31113930

 

How would I get it to match something like "STEAM_0:0:49096012" with a value in the array?

Link to comment
https://forums.phpfreaks.com/topic/261354-preg_match-an-array/
Share on other sites

Ok, how would I convert that into a string?

 

I tried using

 

implode('', $curbans);

 

All I get is an error.

 

What exactly is it you want to achieve? By the looks of your code it doesn't seem to do what I think you want to do at all.

Tell us, and we will help you! :)

Link to comment
https://forums.phpfreaks.com/topic/261354-preg_match-an-array/#findComment-1339411
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.