Jump to content

Recommended Posts

[code]
Warning: preg_match() expects parameter 2 to be string, array given
[/code]

Hello, the above is the error I am receiving, this is the function...

[code]
function audio_files($filelist)
{
  $clean_files = array();
  $extensions = array('\.mp3', '\.aiff', '\.wav', '\.mid'); //add audio extensions
  $read_extensions = '(' . implode('|', $extensions) . ')';

  if(preg_match("#$read_extensions$#", $filelist))
  {
      $clean_files[] = $filelist;
  }
  return $clean_files;
}
[/code]

Note, $filelist contains ftp_nlist(). Now, I'm guessing this could be a problem with my web host, so I'll go 'head and post that to.

[code]
cPanel 10.8.1-STABLE_31 (PRO 1.0 (RC2))
Apache Core 1.3.34
SpamAssasin 3.1
phpMyAdmin 2.6.1-rc1
PHP 4.4.1 AND 5.0.5
PERL 5.8.6
MySQL 4.1.13-standard-log

Processor Name: Intel(R) Celeron(TM) CPU 2.40GHz
Processor speed: 2394.027 MHz
Processor cache size: 128 KB
Operating System: RedHat Enterprise 3
Memory Information: ECC Registered 1024 MB RAM
[/code]

If anyone could resolve the preg_match() error I am having, please do so...help is appreciated.
Link to comment
https://forums.phpfreaks.com/topic/13580-warning-preg_match-expects/
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.