Reputation: 1677
I wanted to quick test a small snippet of PHP code. So, After doing a little search I setup php5-cli using synaptic on my Ubuntu machine.
Now when I tried to run
$ php -a
I get a php prompt. But I am unable to get it to work. I tried :
php > echo 'hi there!'
>
>
php > <?php echo 'hi there!' ?>
>
>
But, nothing seems to work! What am I doing wrong?
[Note: I am not very familiar with PHP]
[Update :
I wish to achieve something like :
php > $url = myurl
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL, $url);
> $body = curl_exec($ch);
> curl_close($ch);
>
> echo $body
]
Upvotes: 1
Views: 1649
Reputation: 95252
You need to terminate your statements with a semicolon.
php > echo "hello"
php > ;
hello
php > echo "oh!";
oh!
php >
Upvotes: 2