Page 1 of 1

string with a spaces

Posted: Fri Oct 25, 2002 2:57 pm
by nnn
Please,help me with my little problem:
i need to create string with a spaces(this is a line):
$line=$string1.$space.string2.$space.$string3 ...
$space=" ";
But finally in $line there are no spaces.
How can i insert spaces between strings?
If anyone could help me out that would be great!

:)

Posted: Fri Oct 25, 2002 3:10 pm
by rev

Code: Select all

<?php
$line = $string1 . " " . $string2 . " " . $string3;
?>

Posted: Fri Oct 25, 2002 4:15 pm
by hob_goblin

Code: Select all

<?
$line = array($string1, $string2, $string3, $string4, $string5, $string6);
$newstring = implode(" ", $line);
?>
might be better if you have alot of strings to join.

Posted: Fri Oct 25, 2002 5:46 pm
by nnn
Thank you very much !
:lol: