The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I have a loop where I add a comma after every result. How can I only have it so a comma is placed after a string?
I want Code:
boo,foo,testing,123 Code:
boo,,testing,123, |
#2
|
||||
|
||||
![]()
I can only guess since you posted no code.
There are many simple ways to avoid this depending on the situation. Why don't you explain more what you are doing and post some code. |
#3
|
|||
|
|||
![]()
Well I'm making multiple drop down menus generated by a query which will be placed on the registration page.
The user can select an option from any or all of the drop down menus. To avoid having to create potentially 100 or more rows in the database I thought I would insert them all into one field then use "explode". The code below inserts the data. PHP Code:
This code retrieves the data PHP Code:
|
#4
|
||||
|
||||
![]()
This will take your original array and create a comma seperated string of the array values.
PHP Code:
|
#5
|
|||
|
|||
![]()
I thought up this code.
PHP Code:
|
#6
|
||||
|
||||
![]()
Why would you do all that?
The code I gave you will turn any array into a string of values seperated by commas. |
#7
|
|||
|
|||
![]()
It lets you know that I'm trying.
For your code I can just use? PHP Code:
|
#8
|
||||
|
||||
![]()
I think he wants your code to do what it dies, but NOT append the comma after the last result
|
#9
|
||||
|
||||
![]()
Implode does not put a comma at the end.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|