This might be old for some of you but I never encountered it until
today and I would like to know why this is happening.

Here's the situation:
php > $a='data[options][name]';
php > echo ltrim($a,'data[');

Just as I expected.

Next one:
php > $a='options[options][name]';
php > echo ltrim($a,'options[');

UH, what?
Not exactly what I expected.

This works:
php > $a='options[options][name]';
php > echo ltrim(ltrim($a,'options'),'[');

Can somebody explain the second behavior? Is this a known bug in PHP,
I'm running PHP 5.2.6 on Ubuntu.

Peter van der Does

GPG key: E77E8E98

WordPress Plugin Developer

GetDeb Package Builder/GetDeb Site Coder - Software you want for Ubuntu

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to