473,804 Members | 3,229 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

joining string

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_c ap," - ",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
4 1557
$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
I think maybe you want to do this:

$value = $disp_cap." - ".substr($value ,0,300);
<so**********@y ahoo.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.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_c ap," - ",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
*** so**********@ya hoo.com wrote/escribió (6 Jun 2005 23:35:02 -0700):
$value = implode($disp_c ap," - ",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
<so**********@y ahoo.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.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_c ap," - ",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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4989
by: Joe | last post by:
I've got 3 columns in a mysql database that I am trying to join. I'm using CONCAT(), but it's giving me NULL results. This has worked for me before ... What am I doing wrong? Here's a straight select: mysql> select peopleID, firstName, middleInit, lastname -> from people; +----------+-----------+------------+------------+ | peopleID | firstName | middleInit | lastname |
4
4296
by: Job Lot | last post by:
Is there anyway of Joining two or more DataTable with similar structure? I have three DataTables with following structures Data, AmountB/F, Repayments, InterestCharged and AmountC/F i want to join these tables on the basis of Date. I don't want three rows for each date, i want the values to be added for similar dates. thanx
1
1673
by: lorenzobaldan | last post by:
I'm a complete vb newby and I'm trying to make one action button to execute two different queries at the same time. I create two different buttons with the wizard and now -i have to merge them in one single script. Can someone help me? Private Sub Comando17_Click() On Error GoTo Err_Comando17_Click Dim stDocName As String
9
1880
by: Eric Sabine | last post by:
Can someone give me a practical example of why I would join threads? I am assuming that you would typically join a background thread with the UI thread and not a background to a background, but since I'm asking in the first place, assume that assumption to be very assuming. thanks, Eric
2
1552
by: Wally | last post by:
Dim var1 as String Dim var2 as String var1="message1" var2="message2" how do I join the two string variables?
1
1743
by: s99999999s2003 | last post by:
hi i have some databse results that are NoneType and DateTimeType. now i have trouble joining these row results together like "|".join(result) as it says cannot join NoneType , DateTimeType . How can i change these types so i can join the columns together as string? thanks
2
2266
by: Supermansteel | last post by:
I am joining these 2 tables together in Access 2003 and can't figure out the exact way of writing this script......Can anyone help? I have the following SQL: SELECT PL_Input.Date_ID,Count(PL_Input.+PL_Input.+PL_Input.+PL_Input.+PL_Input.) AS FROM Country INNER JOIN PL_Input ON Country.Country_ID = PL_Input.Country_ID WHERE (((. & "" & . & "" & . & "" & . & "" & .) Like "*2*"))
1
1417
by: yuva | last post by:
"Thank you for this amazing program. Within a weekend, my team increased with 50 new people joining. Every time I logged on there was a new affiliate. Absolutely amazing. " S. Horvath SOUTH AFRICA No Investment. No Joining Fees. 100% Free to Join. Home based Part time Online Jobs.
7
1997
by: sam.barker0 | last post by:
Hi, I tried to use the java approach to join 2 strings int w=0; string z="blah " + w + "blah " but this gives me an error but this works string z("blah"); z+=w;
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10588
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.