how do i output an array that is inside a for loop and put it in a string twice, the string is inside a function?
this is my simplified code
[code=php]
function myFunction(){
$words = $_POST['text'];
$words = eregi_replace(" +", " ", $words);
$betterWords = explode(' ', $words);
for($x=1; $x < 10; $x++){
$allwordsTogeth er = $betterwords[$x];
echo "hi my name is " . $allwordsTogeth er . "it really is " . $allwordsTogeth er . "<br />";
}
}
echo myFunction();
[/code]
i would like it to echo for exapmle
hi my name is bob johnson it really is bob johnson
this is my simplified code
[code=php]
function myFunction(){
$words = $_POST['text'];
$words = eregi_replace(" +", " ", $words);
$betterWords = explode(' ', $words);
for($x=1; $x < 10; $x++){
$allwordsTogeth er = $betterwords[$x];
echo "hi my name is " . $allwordsTogeth er . "it really is " . $allwordsTogeth er . "<br />";
}
}
echo myFunction();
[/code]
i would like it to echo for exapmle
hi my name is bob johnson it really is bob johnson
Comment