The first element in an array is always at position zero. Code: string $mySelection[] = `ls -sl`; string $firstObj = $mySelection[0] $mySelection[0] is already a string variable, just not as elegant as $firstObj