Click to See Complete Forum and Search --> : Breaking lines of text


aiden857181
10-17-2007, 09:39 AM
Hi Guys sorry about this dumb question but here we go. How do you break a line of text in php. i know html is <br> so whats the php equivelant.


Heres the code im trying to break :


"<form method='POST' name='PayPalForm' action='https://www.paypal.com/cgi-bin/webscr'>\n".
"<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">\n".
"<input type=\"hidden\" name=\"business\" value=\"".$this->_getSettingValue('CONF_PAYMENTMODULE_PAYPAL_MERCHANT_EMAIL')."\">\n".
"<input type=\"hidden\" name=\"item_name\" value=\"Order #".$orderID."\">\n".
"<input type=\"hidden\" name=\"amount\" value=\"".$order_amount."\">\n". "\n".
"Card Holder First Name<input type=\"text\" name=\"first_name\" value=\"".$first_name."\">\n"."\n".
"Card Holder Last Name<input type=\"text\" name=\"last_name\" value=\"".$last_name."\">\n"."\n"."\n".
"Credit Card Number<input type=\"text\" name=\"cc_number\" value=\"".$cc_number."\">\n"."\n".
"CVV Number<input type=\"text\" name=\"cvv2_number\" value=\"".$cvv2_number."\">\n"."\n".
"Email Address<input type=\"text\" name=\"email_address\" value=\"".$email_address."\">\n"."\n".
"Address <input type=\"text\" name=\"address1\" value=\"".$params["first_name"]."\">\n"."\n".
"<input type=\"hidden\" name=\"bn\" value=\"webasyst\">\n".
"<input type=\"hidden\" name=\"return\" value=\"".getTransactionResultURL('success')."\">\n".
" <input type=\"hidden\" name=\"currency_code\" value=\"".$order["currency_code"]."\">\n".
"<input type=\"image\" name=\"submit\" src=\"http://images.paypal.com/images/x-click-but01.gif\" alt=\"".CPAYPAL_TXT_AFTER_PROCESSING_HTML_1."\">\n".

scragar
10-17-2007, 09:42 AM
not sure what your asking here, but I'm gonna guess that your after breaking up the lines of the generated html, in which case the answer is <br />, just like for (x)html.

MrCoder
10-17-2007, 09:45 AM
You should break out of PHP mate.

I assume you have an echo before all that text?


<?php
$i = 0;
echo "This is example 1..<br> I=".$i."<br>";
$i++;
echo "This is example 2..<br> I=".$i."<br>";
?>


Now the version that breaks out of PHP

<?php
$i = 0;
?>
This is example 1..<br> I=<?php echo $i; ?><br>
<?php
$i++;
?>
This is example 2..<br> I=<?php echo $i; ?><br>

aiden857181
10-17-2007, 09:47 AM
Sorry about that i should have more clear.

I have several input boxes wrote in php but when they are displayed they are all bunched up together i am trying to seperate them into individual lines.

MrCoder
10-17-2007, 09:47 AM
Wrap them in a table, use CSS or just use <BR>


"Card Holder First Name<input type=\"text\" name=\"first_name\" value=\"".$first_name."\"><br>\n"."\n".
"Card Holder Last Name<input type=\"text\" name=\"last_name\" value=\"".$last_name."\"><br>\n"."\n"."\n".

aiden857181
10-17-2007, 09:54 AM
Thats the job thanks guys.