I have a variable that represents a user string (it’s an L-DAP string). From this variable, I need to return everything before the first comma and everything after the first equals sign.
Essentially, I just need “mrfoobar11” and that’s all. I tried using substr to get everything after the first equals sign but when I tried to do the same thing with everything up to the first comma, I began to think I needed a RegEx–which I’m betting I don’t.
Here’s one that will allow you to use all the vars. Then you can go right to the first if you’d like. I feel like theres something out there similar to urldecode() that should do this.
Thanks everyone. I went ahead and used cpradio’s strpos approach. Got me what I needed.
Kyle, I never thought about possibly using all the variables… I’ll have to keep that in mind because that might come into play here. And I didn’t even realize that PHP came with some libraries / functions that did stuff with ldap. That’s pretty cool. Thanks.