[pmwiki-devel] php question
Petko Yotov
5ko at 5ko.fr
Thu Jan 22 08:40:28 CST 2009
On Thursday 22 January 2009 15:16:19 Hans wrote:
> Say I have an array $ar with string values (no key names).
> I want to check if there is a value 'xyz', and if there is, I want to
> have it replaced with value 'abc'.
You need array_search();
$key = array_search('xyz', $ar);
if( $key !== null && $key !== false ) $ar[$key] = 'abc';
See : http://php.net/array_search
Thanks,
Petko
More information about the pmwiki-devel
mailing list