Re: [PHP] Re: stripping first comma off and everything after
Troy Oltmanns wrote: http://php.net/manual/en/function.split.php I haven't tested for efficiency but splitting it will be great for assigning it easily into an array. Explode does the same thing without the overhead of a regular expression engine. But the OP didn't want the rest :) Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: stripping first comma off and everything after
http://php.net/manual/en/function.split.php I haven't tested for efficiency but splitting it will be great for assigning it easily into an array. On Fri, Jun 18, 2010 at 7:42 PM, Robert Cummings wrote: > shiplu wrote: > >> I'll use, >> >> list($data) = explode(",",$entries[$i]["dn"]); >> >> > It's probably the least efficient method. > > > Cheers, > Rob. > -- > E-Mail Disclaimer: Information contained in this message and any > attached documents is considered confidential and legally protected. > This message is intended solely for the addressee(s). Disclosure, > copying, and distribution are prohibited unless authorized. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Re: stripping first comma off and everything after
shiplu wrote: I'll use, list($data) = explode(",",$entries[$i]["dn"]); It's probably the least efficient method. Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: stripping first comma off and everything after
I'll use, list($data) = explode(",",$entries[$i]["dn"]); Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: stripping first comma off and everything after
Why not this? $var = explode(",",$entries[$i]["dn"]); $var = $var[0]; "Adam Williams" escreveu na mensagem news:4c1bcf62.5070...@bellsouth.net... > I'm querying data and have results such as a variable named > $entries[$i]["dn"]: > > CN=NTPRTPS3-LANIER-LD335c-LH107-PPRNP9A92,OU=XXf,OU=XX,OU=X,DC=,DC=xx,DC=xxx > > Basically I need to strip off the first command everything after, so that > I just have it display CN=NTPRTPS3-LANIER-LD335c-LH107-PPRNP9A92. > > I tried echo rtrim($entries[$i]["dn"],","); but that doesn't do anything. > Any ideas? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php