PLS SOLVE PHP PROGRAM ERROR

PHP Warning: explode() expects parameter 2 to be string, array given in /var/www/html/test.class.php on line 23
Please solve this error as soon as possible. :)[size=12pt][/size]

<?php class Test { private $msg; private $arr; private $arr1; public function __construct() { $this->msg = ''; } function msg($str,$str1) { $msg[]= $str.'-'.$str1; return $msg; } } $objtest = new Test(); $msgbox[] =$objtest->msg('pankaj','pankaj'); $msgsep=explode('-',$msgbox); echo $msgsep[0]; ?>

explode — Split a string by string
http://php.net/manual/en/function.explode.php

You can’t explode an array.

Sponsor our Newsletter | Privacy Policy | Terms of Service