|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-04-24 13:06 UTC] sbw at sbw dot org
See http://sbw.sbw.org/str_replace/. str_replace(-string-, -string-, -array-) should return an array. It appears that it does so, but when the returned array is passed to implode or each, PHP issues warnings: "Bad arguments to implode()" "Variable passed to each() is not an array or object" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 07:00:01 2025 UTC |
It works in latest CVS. $input = array('foobar', 'barhop'); var_dump(implode(' : ', str_replace('bar', '---', $input))); Output: string(15) "foo--- : ---hop"