simple echo command problem

This is where you share YOUR scripts with others

Moderators: macek, egami, gesf

jotish
New php-forum User
New php-forum User
Posts: 1
Joined: Mon Mar 12, 2012 9:09 am

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

LarryMade
New php-forum User
New php-forum User
Posts: 41
Joined: Wed Mar 14, 2012 5:21 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


Return to “Your Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests