|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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. |
|
#2
|
||||
|
||||
|
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? |
|
#3
|
||||
|
||||
|
Re: PHP Question
rock on! Thanks!
|
|
#4
|
||||
|
||||
|
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>'; It's sending out 1234 in red Last edited by Kingofl337 : 25-01-2007 at 17:14. |
|
#5
|
|||||
|
|||||
|
Re: PHP Question
Change the $Current_Version in your second line to $Print_Version and you should be ok, if I'm understanding right.
|
|
#6
|
||||
|
||||
|
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
Last edited by Kingofl337 : 25-01-2007 at 17:13. |
|
#7
|
|||||
|
|||||
|
Re: PHP Question
wouldn't this work?
Code:
echo "$val[1].$val[2].$val[3].$val[4]"; Last edited by Cuog : 25-01-2007 at 19:49. |
|
#8
|
|||
|
|||
|
If you'd like to get fancy:
PHP Code:
|
|
#9
|
|||
|
|||
|
Re: PHP Question
PHP Code:
just feedback if don't.. ![]() Last edited by felipe.tonello : 25-01-2007 at 16:39. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |