What you did should work (as long as you print $row).
But that may not be the most efficient as it executes the command and builds an array (so the data is not available until the executable finishes).
What would be better is to use popen(). This executes the command but provides the output of the executable as a file stream (to the rest of your code it looks like an open file). So you can just read the stream like you would read a file.
$handle = popen(str_replace('\classes', '', dirname(__FILE__)) . '\data\vedur ');
if ($handle) {
while (($line = fgets($handle)) !== false) {
// process the line read.
}
pclose($handle);
} else {
// error opening the file.
}
Note: My PHP foo is not strong. So make appropriate checks.
Another note: I assume you are calling the C++ from PHP because you are using the PHP to generate all the correct headers etc.
But if you can do that from the C++ you can potentially call the C++ directly from your web server without using the PHP layer.
popen?popendoesn't do what you want, or?