Jump to content

Recommended Posts

     $head .= ' 		
			  <form method="post" method="index2.php">
	  			<div style="margin-bottom:10px; margin-top:20px; color:#FFFFFF">login
				    <br />
	  			  <input class="inputfields" type="text" name="username" />
	  			</div>
	  			<div style="margin-bottom:10px; color:#FFFFFF">
              password
	  				<input class="inputfields" type="password" name="pwd" />
	  			</div>
	  			<div><input type="submit" name="login" value="Login" /></div>
	  		</form>';
		}
	  $head .= $msg;	
    $head .= '</div>';

 

$head .= '

These are all throughout my site. What does it mean? When I try to add a div I can't. What's the purpose of placing a div into the site by using $head.? 

Link to comment
https://forums.phpfreaks.com/topic/239114-please-explain-this-small-code-to-me/
Share on other sites

Um, this is kind of a broad question. The exact point of this code is unclear, as we never see what is done with the $head variable.

 

However, what the code is doing is pretty easy to explain.

 

first things first, this

.=

 

this is a compound operator, like += or -=, which basically means this

$head .= "some string";
//the above is the same as
$head = $head . "some string";

 

recall that the period (.) operator in PHP is the concatenation operator. Concatenation is basically adding two strings together.

 

Now, the point of your code seems to be concatenating some HTML together. WHat happens to this html is unclear as you havent posted what your code does with $head

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.