Board index   FAQ   Search  
Register  Login
Board index PHP Your Scripts

simple echo command problem

This is where you share YOUR scripts with others

Moderators: macek, egami, gesf

simple echo command problem

Postby jotish » Mon Mar 12, 2012 9:14 am

hi...i have a simple snippet...
<?php
echo 'cout<<a[i];';
?>
i expect this output from it...cout<<a[i];
but it gives me only cout<
please help
jotish
New php-forum User
New php-forum User
 
Posts: 1
Joined: Mon Mar 12, 2012 9:09 am

Re: simple echo command problem

Postby LarryMade » Thu Mar 15, 2012 7:13 am

it sees the <a and starts to process it as an HTML a tag, the ways around that are:

cout << a[i]; <-adding a space

cout &lt;&lt;a[i]; <- forcing less than symbols
LarryMade
New php-forum User
New php-forum User
 
Posts: 41
Joined: Wed Mar 14, 2012 5:21 am


Return to Your Scripts

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.