Array ( [0] => hello every one this is my ne [1] => w post )
this is one of the output of print_r(str_split($f)))
so how can i remove Array "( [0] =>" and "[1] =>" and all this type of words...
php problem
Moderators: egami, macek, gesf
Please read about array_pop() from the php manual
http://php.net/manual/en/function.array-pop.php
http://php.net/manual/en/function.array-pop.php
-
- php-forum Fan User
- Posts: 973
- Joined: Mon Oct 01, 2012 12:32 pm
alternatively you could do it like:
Code: Select all
$variable = array('this is some arbitar','y text for an',' example.');
$output = '';
foreach ($variable as $fragment){
$output.=$fragment;
}
echo $output;
johnj wrote:Please read about array_pop() from the php manual
http://php.net/manual/en/function.array-pop.php
I dont want to remove the element of the array, i want to remove just text "Array" as mentioned in my problem.
What is the value of $fragment?seandisanti wrote:alternatively you could do it like:
Code: Select all
$variable = array('this is some arbitar','y text for an',' example.'); $output = ''; foreach ($variable as $fragment){ $output.=$fragment; } echo $output;
-
- php-forum Fan User
- Posts: 973
- Joined: Mon Oct 01, 2012 12:32 pm
It depends on the iteration. on each time through the loop, $fragment contains the value from a different index in the array