/    Sign up×
Community /Pin to ProfileBookmark

Fix "syntax error" codes

I’m not a PHP expert and am having some trouble to correct this php structure:

[code]<?php if ($info != ”) {
echo ‘<tr>”<td class=”td01″>”<strong>’ . Detail . ‘</strong>’ . : . ‘<td class=”td01 td02″>’ . $info . ‘</td>”</tr>’;
}?>[/code]

Basically I’m trying to get the codes to output html markup like this if it gets $info data:

[code]<tr><td class=”td01″><strong>Detail</strong>:<td class=”td01 td02″>output info</td></tr>[/code]

Appreciate any help fix it.

monkeybloke

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@scragarAug 14.2008 — [code=php]<?php if ($info != '') {
echo "<tr><td class='td01'><strong>Detail</strong>:<td class='td01 td02'>{$info}</td></tr>";
}?>[/code]

stop over complicating things ?
Copy linkTweet thisAlerts:
@Stephen_PhilbinAug 14.2008 — Well given that there are so many different and perfectly valid ways of doing the same thing, it's easy to get mixed up when you're just getting the swing of things. Check out the [url=http://devzone.zend.com/manual/language.types.string.html]PHP manual's section on strings[/url], monkeybloke. It should hopefully help to clear up a lot of the confusion.
×

Success!

Help @monkeybloke 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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