Arrays, text areas and concatenation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Flashart
Forum Commoner
Posts: 71
Joined: Tue Oct 06, 2009 12:12 pm

Re: Arrays, text areas and concatenation

Post by Flashart »

Hi yes I noticed that almost soon after i posted!

I have changed it so it reads

Code: Select all

if(isset($_POST['exact_match']));
		{	
			foreach ($kword1Array as $key => $value)
				{
				
			echo '['.$value.']<br />';
			}
			}
and that array is here:

Code: Select all

if (isset($_POST['submit'])){

	$firstKwordarea = $_POST['kword_area_1'];
    $secondKwordarea = $_POST['kword_area_2'];
    $thirdKwordarea = $_POST['kword_area_3'];
    $fourthKwordarea = $_POST['kword_area_4'];
    $pre_multiplier = $_POST['pre_multiplier_area'];
      
    //Arrays
    $kword1Array = explode("\n", $firstKwordarea);
    $kword2Array = explode("\n", $secondKwordarea);
    $kword3Array = explode("\n", $thirdKwordarea);
    $kword4Array = explode("\n", $fourthKwordarea);
    $pre_multiplier_Array = explode("\n", $pre_Multiplier_area);
    }
Yet i still get the error message. Clearly I have not understood something but I don't know what to change in order to correct it?
Flashart
Forum Commoner
Posts: 71
Joined: Tue Oct 06, 2009 12:12 pm

Re: Arrays, text areas and concatenation

Post by Flashart »

ah...

spotted the extraneous ;

Code: Select all

if(isset($_POST['exact_match']))
                {       
                        foreach ($kword1Array as $key => $value)
                                {
                                
                        echo '['.$value.']<br />';
                        }
                        }
which has got rid of the error, but I still don't get any output at all?
Flashart
Forum Commoner
Posts: 71
Joined: Tue Oct 06, 2009 12:12 pm

Re: Arrays, text areas and concatenation

Post by Flashart »

I still am a bit stuck on this. Any help would be greatly appreciated. Thanks!
Post Reply