Current location: Hot Scripts Forums » Programming Languages » PHP » How do I enter a line break on my "$msg=" line?


How do I enter a line break on my "$msg=" line?

Reply
  #1 (permalink)  
Old 04-18-06, 03:27 PM
baygirl baygirl is offline
New Member
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question How do I enter a line break on my "$msg=" line?

OK... I have a ticker code I have used for some time. A friend helped me design it awhile back.

So it has an image that slides over the other and then prints text below.

How can I break up the text into 2 lines instead of just one?

Part of the code is below
PHP Code:

if ($weeks_preg 0)

$msg 'We are ' $weeks_preg ' week' . ($weeks_preg 's' '');
if (
$days_preg 0)
{
if (isset(
$msg))
$msg .= ' & ';
$msg .= $days_preg ' day' . ($days_preg 's' '');
}
$msg .=  ' pregnant.';
if (
$weeks_left 0)
$msg .= $weeks_left . ($weeks_left ' weeks' ' week');
if (
$days_left)
{
if (
$weeks_left 0)
$msg .= ' and ';
$msg .= $days_left_induce . ($days_left_induce ' days' ' day');
$msg .= ' until Hunter is induced!'
After $msg .= ' pregnant.';, I would like a line break.

Can anyone help? I tried a few things and none worked.

Last edited by Christian; 04-18-06 at 06:02 PM. Reason: Please use [PHP][/PHP] when posting PHP code!
Reply With Quote
  #2 (permalink)  
Old 04-18-06, 03:50 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Change
PHP Code:

$msg .= ' pregnant.'
to
PHP Code:

$msg .= " pregnant.\n"
Reply With Quote
  #3 (permalink)  
Old 04-18-06, 04:17 PM
baygirl baygirl is offline
New Member
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
http://www.tara-nicole.com/ticker/tick1.php

I get a funky character in the place of the line break.. I had tried your suggestion previously with the same results.

it's like a Y with a line through its stem.
Reply With Quote
  #4 (permalink)  
Old 04-18-06, 05:39 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Aah, I had a similar issue earlier today. I think you have to add a second imagestring() for a new line. I didn't look further into it though.

http://php.net/manual/en/function.imagestring.php
Reply With Quote
  #5 (permalink)  
Old 04-18-06, 06:53 PM
baygirl baygirl is offline
New Member
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
i was thinkign abotu that but didnt try it before..

did it now and viola! thanks so much!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirection back to a page from form submit DAL Perl 11 03-21-05 02:45 PM
I most definately suggest DevelopingCentral.com For Any Website Design/Development! Salty777 General Advertisements 2 10-01-04 04:27 AM
asp-iis-Server error nsuresh_rasr ASP.NET 3 02-08-04 12:47 AM
Declared Functions skipper23 PHP 4 12-17-03 10:06 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM


All times are GMT -5. The time now is 07:10 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.