How to Store Shell Command output(line by line) into array?

  • wai_wai9339
  • Novice
  • Novice
  • wai_wai9339
  • Posts: 31

Post 3+ Months Ago

Hi, all the genius may help me to solve some smal problem..

i have a shell command. then i wan to store the output (line by line) into a array so that i can display out.

$out = shell_exec(ldapsearch -x | grep uid);

The out put is
dn: uid=administrator,ou=People,dc=stt,dc=com,dc=my
uid: administrator
uidNumber: 0
dn: uid=smart-tech01$,ou=Hosts,dc=stt,dc=com,dc=my
uid: smart-tech01$
uidNumber: 1002

How can i display out in the php web so that it will look like
uid
administrator
smart-tech01$

Thank you for reply me.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 10 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.