Jump to content

Replace array values with single variable


MFA

Recommended Posts

I am wondering how to replace several values in an array with a single variable. I have tried just simply creating a variable for all the values within the array (e.g. $variable = $round1.",".$round2.",".$round3) and substituiting that in however it doesn't work as the array understands the comma's literally and outputs them on the page. The original line of code is below. Thank you.

$myData->addPoints(array($round1,$round2,$round3),"Frequency");

 

 

Link to comment
Share on other sites

Yes I know, it's difficult to explain. Unfortunately, I have to use an array, this is template code from pChart and I have to fill in the array values as they represent the values of the bar graphs.

I am still not sure how to go about this using the list() function.

Edited by MFA
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.