请问PHP里有 $aaa="hello world!";怎么一位一位的判断这个字符串,像c++里
string a="hello world!";int sum=0; for(int i=a.size()-1;i>=0;i--){ if (a[i]=='l') sum++; } cout<<sum;
请问PHP里怎么实现同样的功能?