Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting question

Status
Not open for further replies.

fergmj

Programmer
Feb 21, 2001
276
US
I have some code

<tr>
309 <td align="center" valign="top" class="style6"><span class="style11">A:</span></td>
310 <td width="1%" align="center" valign="top" class="style6">&nbsp;</td>
311 <td class="style6"><?=_p('No, our wireless site is always 100% free to you.')?></td>
312 </tr>

it prints out on the screen as

A: No, our wireless site is always 1000.000000ree to you.

any ideas why?

thanks
 
Not enough information.
As far as I can gather _p() is a function. What does the function do to the string you are giving it?

We need more of the code involved if you want any kind of intelligent answer.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Try using doublequotes and see what happens.
<?=_p("No, our wireless site is always 100% free to you.")?>

I'm guessing it's the % sign.
 
i suspect, actually, it's more to do with the printf underlying the _p function, as vacunita hints at.

% is a 'special' character and to make it properly displayable across charsets it is better to use the html entity instead.
Code:
<td class="style6"><?=_p('No, our wireless site is always 100&#37; free to you.')?></td>

 
Another thing to note, does the _p function return a value or does it output the text directly to the buffer/user ?

If it outputs the text directly, remove the = sign before you call it.
You use that to echo results, example:
Code:
<?
$myvar = " world!";
?>
<html>
Hello <?=$myvar?>!
</html>
Result: Hello world!
or you could use something like:
Code:
<?echo $myvar;?>
and it would have the same effect, its just easier to replace the word echo with an = sign.

The reason I mention this is because if your function returns a result, for example: 1 on success or 0 on false. then your output would have the text you passed, and at the end contain the result of the function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top