# php script problem

**URL:** <https://community.unix.com/t/php-script-problem/313055>\
**Category:** Shell Programming and Scripting\
**Created:** [July 5, 2012, 9:00am UTC](https://community.unix.com/t/php-script-problem/313055 "2012-07-05T09:00:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SkySmart](https://community.unix.com/letter_avatar/skysmart/32/6_22734026db12803ebb3e059622ac3534.png) [@SkySmart](https://community.unix.com/u/SkySmart)\
**Post date:** [July 5, 2012, 9:00am UTC](https://community.unix.com/t/php-script-problem/313055/1 "2012-07-05T09:00:16Z")

</div>

```nohighlight
 $result = shell_exec("/sbin/checkscript.sh jdoe");
 echo "$result" ;

```

i am running a script through php. the script is /sbin/checkscript jdoe.

this script is supposed to output something similar to this:

```nohighlight
################################
#### Welcome John Doe
################################

```

The problem is, in the webpage, php doesn't show the output of the script as cleanly as this.

it meshes them all together in one line like this:

```nohighlight
#################################### Welcome John Doe ################################

```

how can i modify my php code so that whatever the script returns shows up in the webpage just as it would have from the commandline?

i have tried removing the quotes on the "results". same problem. any ideas?
