Jump to content
Veriu Forum
Sign in to follow this  
g°n

Gjithcka Rreth Php. Shpjegime

Recommended Posts

Kjo sherben qe ju te beni kerkesa dhe shpjegime rreth programimit ne PHP.

 

Ne rradhe te pare PHP nje faqe fillon me taget echo "hi"; ?> pra:

 

<?
echo "Pershendetje";

?>

Pra taget dhe ?> sherbejne qe serveri ku ndodhet adresa ose file -i ta identifikoje ate si kod PHP.

Kodi 'echo' sherben te shfaqe nje permbajtje ne faqen tone.

Per cdo mbyllje te kodit ose fjalie nqs do ta quanim keshtu finalizohet me ';'

Variabel -at zene nje vend te rendesishem ne kodin php. Me ane te php mund krijojme globale qe mepas sherbejne te perdoren ne faqet php. Variabelet krijohen direkt nga faqja dhe kodi por edhe serveri PHP qe hoston faqen rezervon variabela te gatshme.

 

Rasti i krijimit te nje variabeli ne file -in php:

<?
$numer = 1;
$numer2 = 2;

if ($numer < $numer2) {
                      echo "$numer eshte me i vogel se $numer2";
}
?>

 

Rasti i nje variabeli nga sistemi:

 

<?
$data= date('Y');

echo "Viti $data";

?>

 

 

echo"

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...