Hello,
I am trying to implode an array in a $_POST[]. I am doing this inside of a loop which searches for values in ~31 arrays...$_POST['1'], $_POST['2'], $_POST['3'], etc.
I am trying to do this with:
while($i <= $_SESSION['daysInMonth']){
$month = $_SESSION['month'];
$day = $i;
$names = implode(',',$_POST['names_'.$i]);
$region = $...
Hello,
I'd like to store associative array containg mostly strings and integers as values in db.
I was thinking:
implode/explode - need to find delimiter, which won't be in values - since it's almost user generated, not safe
XML - feels to heavy for the job (creating/reading values)
json - if i need only to work with json_decode/json...
Hi guys,
I would like to output my php array into this format: [1991, 6.5], [1992, 4], [1993, 5.9]
PHP array:
while ($row = mysqli_fetch_array($result))
{
$metals[] = array('year' => $row['year'],
'metal' => $row['metal'];
}
I have seen some examples of implode function but I couldn't find any that could matc...
$array = array('item1', 'item2', 'item3', 'item4', 'item5');
here i want to extract only the first three items in the array, and then
$implodes = implode(';', $array);
echo $implodes;
which should output
item1;item2;item3
$i=0;
$new = array();
foreach($array as $arr)
{
$i++;
if($i <= 3)
{
$new[] = $arr;
}
}
doesn't ...
$pieces = explode(",", $userList);
$key=array_search($deleteuser, $pieces);
if(FALSE !== $key)
{
unset($pieces[$key]);
}
else
return FALSE;
$userList = implode(",", $pieces);
I'm looking for inputs into how to rework this code to remove an element from a CSV list. The user should exist in this system and it should work fine e...
How to implode foreach() with comma?
foreach($names as $name) {
//do something
echo '<a href="' . $url . '" title="' . $title . '">' . $name .'</a>';
}
Want to add comma after each link, except the last one.
...
hi friends I have a php array for eg.
$mob_numbers= array(12345674, 12345675, 12345676,12345677);
I want to eacho out all of them at once so that it appears
12345674,12345675,12345676,12345677 (with comma) .
How do i do it ? I tried array explode, didn't work. Pls help
...