/    Sign up×
Community /Pin to ProfileBookmark

Why are table tags like ttt ???

I was editing through some PHP code, I need to change a table but I’ve noticed its all coded like:

echo “tttttt<span id=’jcart-subtotal’>” . $text[‘subtotal’] . “: <strong>” . $text[‘currency_symbol’] . number_format($this->total,2) . “</strong></span>n”;
echo “ttttt</th>n”;
echo “tttt</tr>n”;

Whats this?
Why is it like that? and how to i change it or understand what row or cell I am in.

Thanks

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@aj_nscAug 11.2010 — http://php.net/manual/en/language.types.string.php

Scroll down the page a little ways to escaped characters.

The t's are just there to make viewing and understanding the output of the code much easier by nesting the tags properly.
Copy linkTweet thisAlerts:
@arrielmabaleAug 11.2010 — Just make sure your organized in using html in strings,

these things are tricky and really hard to debug.

Always put your codes in new line whenever you use these

escape chars for your own convinience.
Copy linkTweet thisAlerts:
@jason87authorAug 12.2010 — Ok so if i get rid of all of these ttttttt's it shouldnt affect the actual code right?
Copy linkTweet thisAlerts:
@arrielmabaleAug 12.2010 — Ok so if i get rid of all of these ttttttt's it shouldnt affect the actual code right?[/QUOTE]

these characters serves as functions like "newlines" "tabs" "specials characters"

that construct the formating of your string in the interface. These helps you in properly paragraphing your content's.

ttttttt's

These escape chars adds tab spaces in your content (7 tabs spaces).

removing them removes the tabs spaces, okhie now ^_^ .

Check sire aj_nsc link for further information on escape chars equivalent.
Copy linkTweet thisAlerts:
@NogDogAug 12.2010 — Ok so if i get rid of all of these ttttttt's it shouldnt affect the actual code right?[/QUOTE]

All they do is affect the way the HTML source looks, but they won't affect how the browser displays the page. If you're not interested in making the HMTL source "pretty", then getting rid of them will save a few bytes that have to be transferred on each page request, and also keep your PHP source code a wee bit smaller and easier to read. Basically it just depends on where your priorities lie.

Personally, I almost never worry about it, and if for some reason I do want to indent my HTML source (e.g. to debug a display issue), I let [url=http://www.charles-reace.com/blog/2008/09/05/tabbed-ouput-with-tidy/]Tidy do the work[/url]. ?
Copy linkTweet thisAlerts:
@jason87authorAug 12.2010 — All they do is affect the way the HTML source looks, but they won't affect how the browser displays the page. If you're not interested in making the HMTL source "pretty", then getting rid of them will save a few bytes that have to be transferred on each page request, and also keep your PHP source code a wee bit smaller and easier to read. Basically it just depends on where your priorities lie.

Personally, I almost never worry about it, and if for some reason I do want to indent my HTML source (e.g. to debug a display issue), I let [url=http://www.charles-reace.com/blog/2008/09/05/tabbed-ouput-with-tidy/]Tidy do the work[/url]. ?[/QUOTE]


Thanks a lot.

Yeah they just confused me when I saw them, got rid of them now anyway, bit confusing and in the way when your working with the code.
×

Success!

Help @jason87 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...