By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 1,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

joining string

P: n/a
I'm new to php and have read the implode statement on php.net but I
guess I still don't understand it. Below is what I have:

$value = implode($disp_cap," - ",substr($value,0,300));

$disp_cap = Office Space
$value = 3,000 sq.ft. located at the intersection of...

I need the $value to join the two so I would get
Office Space - 3,000 sq.ft. located at the...

I get the error:
Warning: Wrong parameter count for implode() in
/home/GQ/public_html/bb/test.php on line 92

Thanks,
Chris

Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
$a = "Hello";
$b = "world";
$c = $a." ".$b;

echo $c;

"Hello World"

Is that what you want to do? Use the . "dot" to concat strings.

Jul 17 '05 #2

P: n/a
I think maybe you want to do this:

$value = $disp_cap." - ".substr($value,0,300);
<so**********@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I'm new to php and have read the implode statement on php.net but I
guess I still don't understand it. Below is what I have:

$value = implode($disp_cap," - ",substr($value,0,300));

$disp_cap = Office Space
$value = 3,000 sq.ft. located at the intersection of...

I need the $value to join the two so I would get
Office Space - 3,000 sq.ft. located at the...

I get the error:
Warning: Wrong parameter count for implode() in
/home/GQ/public_html/bb/test.php on line 92

Thanks,
Chris

Jul 17 '05 #3

P: n/a
*** so**********@yahoo.com wrote/escribió (6 Jun 2005 23:35:02 -0700):
$value = implode($disp_cap," - ",substr($value,0,300)); Warning: Wrong parameter count for implode() in
/home/GQ/public_html/bb/test.php on line 92


http://www.php.net/implode

As you can see, implode() does _not_ have three arguments.

--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #4

P: n/a
<so**********@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I'm new to php and have read the implode statement on php.net but I
guess I still don't understand it. Below is what I have:

$value = implode($disp_cap," - ",substr($value,0,300));

$disp_cap = Office Space
$value = 3,000 sq.ft. located at the intersection of...

I need the $value to join the two so I would get
Office Space - 3,000 sq.ft. located at the...


I think simple concatenation would be better for what you want to achieve:

$finalString = $disp_cap . " - " . $value;

Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.