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