Go to Post In FIRST, success = inspiration. - Daniel Brim [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications > Website Design/Showcase
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 25-01-2007, 16:21
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
PHP Question

I want to print a number string but I'm having trouble.

$Value = '1234';
$Print_Value = $Current_Version[0] . $Current_Version[1] . $Current_Version[2] . $Current_Version[3] ;
echo ("$Print-Value");

I want it to print 1.2.3.4.

I know that $ST=$STR.$STR1 combines strings but I can't figure how to
get the desired output.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #2   Spotlight this post!  
Unread 25-01-2007, 16:26
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
Re: PHP Question

$a = 'bre';
$b = 'athe';

$out = $a.$b; // $out = breathe
$out = $a . '.' . $b; // $out = bre.athe

You need to also "dot" in the period. Even with that I still don't fully understand your question.. do you want to print the value in $Value, with periods between all the numbers, or are the digits in CurrentVersion?
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003
  #3   Spotlight this post!  
Unread 25-01-2007, 16:30
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: PHP Question

rock on! Thanks!
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #4   Spotlight this post!  
Unread 25-01-2007, 16:36
felipe.tonello felipe.tonello is offline
Brazil rox!
AKA: Felipe Ferreri Tonello
FRC #1382 (Tribotec)
Team Role: Webmaster
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Brazil
Posts: 14
felipe.tonello is on a distinguished road
Send a message via MSN to felipe.tonello
Re: PHP Question

PHP Code:
<?
$Value 
'1234';
$Print_Value '';
for (
$i 0$i strlen($Value); $i++){
  if (
$i != (strlen($Value) - 1))
    
$Print_Value .= $Value{$i} . '.';
  else
    
$Print_Value .= $Value{$i};
}

echo 
$Print_Value;
?>
I believe is something like that, you are waiting for..
just feedback if don't..

__________________
BRAZIL * #1382

Last edited by felipe.tonello : 25-01-2007 at 16:39.
  #5   Spotlight this post!  
Unread 25-01-2007, 16:40
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: PHP Question

Ok one more

Code:
$Print_Version =  $Current_Version[0].'.'.$Current_Version[1].'.'.$Current_Version[2].'.'.$Current_Version[3]; 
$comment='<font color="red"><b>'.$Print_Version.'</b></font>';
I need the output to be in red 1.2.3.4
It's sending out 1234 in red
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 25-01-2007 at 17:14.
  #6   Spotlight this post!  
Unread 25-01-2007, 16:44
Brandon Martus's Avatar Unsung FIRST Hero
Brandon Martus Brandon Martus is offline
busy.
AKA: B. Slash Kamen
no team
 
Join Date: May 2001
Rookie Year: 1998
Location: Nevada, TX USA
Posts: 5,271
Brandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond reputeBrandon Martus has a reputation beyond repute
Send a message via ICQ to Brandon Martus Send a message via AIM to Brandon Martus Send a message via Yahoo to Brandon Martus
Re: PHP Question

Quote:
Originally Posted by Kingofl337 View Post
Ok one more

Code:
$Print_Version =  $Current_Version[0].'.'.$Current_Version[1].'.'.$Current_Version[2].'.'.$Current_Version[3]; 
$comment='<font color="red"><b>'.$Current_Version.'</b></font>';
I need the output to be in red 1.2.3.4
It's sending out 1234 in red
Change the $Current_Version in your second line to $Print_Version and you should be ok, if I'm understanding right.
__________________
Brandon Martus
e-mail
  #7   Spotlight this post!  
Unread 25-01-2007, 17:09
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: PHP Question

Thanks for the idea, but, that didn't fix it. I Just copied it wrong. It's still printing 1234 instead of 1.2.3.4
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni

Last edited by Kingofl337 : 25-01-2007 at 17:13.
  #8   Spotlight this post!  
Unread 25-01-2007, 19:45
Cuog's Avatar
Cuog Cuog is offline
Registered Linux User: 390661
AKA: Alex
FRC #0422
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Richmond, Virginia
Posts: 852
Cuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond repute
Send a message via AIM to Cuog
Re: PHP Question

wouldn't this work?


Code:
echo "$val[1].$val[2].$val[3].$val[4]";
__________________
KK4KQO
http://voltair.us
Too many projects, too little time.

Last edited by Cuog : 25-01-2007 at 19:49.
  #9   Spotlight this post!  
Unread 25-01-2007, 20:46
pheadxdll pheadxdll is offline
Registered User
AKA: Alex
FRC #1225 (Amperage Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: North Carolina
Posts: 168
pheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud ofpheadxdll has much to be proud of
Thumbs up Re: PHP Question

If you'd like to get fancy:

PHP Code:
// I like p instead of font :)
echo "<p style='color: red;'><b>";
foreach(
$Current_Version as $value) {
     echo 
"$value.";
}
echo 
"</b></p>"
There's probley other simple ways but meh its something to try if your stuck.
__________________
Amperage Robotics Team 1225
Site under-going revamp. :/
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP question Billfred Website Design/Showcase 4 13-10-2004 09:48
PHP Question Joshua May Website Design/Showcase 9 11-06-2004 20:50
MySQL/PHP Query question Raven_Writer Website Design/Showcase 6 24-05-2004 18:09
PHP Question Raven_Writer Website Design/Showcase 2 22-05-2004 18:42
PHP bb... Stefan Website Design/Showcase 3 31-07-2003 13:48


All times are GMT -5. The time now is 01:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi