I am wondering if such characters can be used in php, which can be used in C++:
characters:
Tab: \t
Line break: \n
etc.
I have to use <br> for \n (it works).
But what TAG or something are similar to \t in php?
\t is useful for displaying (echo or print) text nicer.
thanks
character Tab in php and C++
Moderator: General Moderators
-
php12342005
- Forum Commoner
- Posts: 79
- Joined: Mon Mar 21, 2005 3:35 am
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
php12342005
- Forum Commoner
- Posts: 79
- Joined: Mon Mar 21, 2005 3:35 am
Hi,
I tested your comment:
add php code:
-----------------------------
print("hello			\n");
print("hello			\n");
output is
-----------------
hello hello
You see, only one space character between 2 "hello"s
I think the space char is "\n" rather than Tab
so it looks Tab (	) doesn't work.
I tested your comment:
add php code:
-----------------------------
print("hello			\n");
print("hello			\n");
output is
-----------------
hello hello
You see, only one space character between 2 "hello"s
I think the space char is "\n" rather than Tab
so it looks Tab (	) doesn't work.
you need the semi-colon 	 to terminate an "html entity reference".php12342005 wrote:Hi,
I tested your comment:
add php code:
-----------------------------
print("hello			\n");
print("hello			\n");
output is
-----------------
hello hello
You see, only one space character between 2 "hello"s
I think the space char is "\n" rather than Tab
so it looks Tab (	) doesn't work.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
You're missing your semi-colons after 	
It is the correct and documented ascii code for it
&ht; (horizontal tab) may also work but I'd recommend going with numbered entities for that sort of thing.
Is there a reason you really must use tab? You can use multiple times OR lay your data out in tables or with CSS for the best control over presentation.
It is the correct and documented ascii code for it
&ht; (horizontal tab) may also work but I'd recommend going with numbered entities for that sort of thing.
Is there a reason you really must use tab? You can use multiple times OR lay your data out in tables or with CSS for the best control over presentation.
-
php12342005
- Forum Commoner
- Posts: 79
- Joined: Mon Mar 21, 2005 3:35 am
is code this way?
print("hello \n");
print("hello \n");
but output is the same.
(	 with a semi-colon can not be desplayed)
print("hello \n");
print("hello \n");
but output is the same.
(	 with a semi-colon can not be desplayed)
Last edited by php12342005 on Sat Jul 23, 2005 12:09 pm, edited 3 times in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
I wouldn't work up a sweat over it. It's not something that's commonly used in presentation and perhaps not supported on some browsers (I think there's only 3 ascii chars in the range 0-31 or something which are actually allowed in HTML).
Try using or doing the proper thing and using CSS or tables
Try using or doing the proper thing and using CSS or tables