Skip to main content

PHP First Program

Syntax 
Recall: From our last post we discussed about syntax, but let's take an insight.
Below are the opening and closing syntax of a php.
Opening tags:
<?php
<?
<script language='php'>
Closing tags:
?>
?> (short tag)
</script>

PHP echo
 The echo statement helps in inserting words into a web page. The echo statement is used more often in PHP. A statement can be echoed using the following types:

  • Single Quote
  • Double Quotes
  • Without Quote
  • "here document" method 
Let's take a "hello simply lecture" example:

<?php
echo 'hello simply lecture';  //single quote
echo "hello simply lecture"; //double quote
echo hello simply lecture; //without quote
echo <<<END
hello simply lecture
END;
?>

Comments

Popular posts from this blog

Maxwell fourth equation

The Maxwell fourth equation is called "the modified Ampere's circuital law". Statement: It states that the line integral of the magnetic field H around any closed part or circuit is equal to the current enclosed by the path. Differential form (without modification): That is, $$\int H.dL = I$$ Let the current be distributed through the current with current density J, then: $$I = \int J. ds$$ This implies that: $$\int H.dL = \int J.ds$$ .........(9) Applying Stokes theorem to the LHS of equ(9) to change line integral to surface integral we have: $$\int_{s} (\nabla X H).ds = \int_{s} J.ds$$ Since, two surface integrals are equal only if their integrands are equal. Thus, $$\nabla X H =J$$ .........(10) Equ(10) is the differential form of Maxwell fourth equation (without modification) Take divergence of equ(10) $$\nabla.(\nabla X H) = \nabla.J$$ Since, the divergence of the curl of a vector is zero.  Therefore, $$\nabla.(\nabla X H) = 0$$ It means that $...

Time dependent Schrodinger equation

Recall from the time independent Schrodinger equation: $$-\frac{\hbar^{2}}{2m} \nabla^{2} \psi(r) + V(r) \psi(r) = E \psi(r)$$ ........(1) Multiply both sides of equ (1) by \(\phi(t)\), we have: $$-\frac{\hbar^{2}}{2m} \nabla^{2} \psi(r) \phi(t) + V(r) \psi(r) \phi(t) = E \psi(r) \phi(t)$$ ..........(2) Recall: $$\psi(r) \phi(t) = \Psi(r,t)$$ .............(3) Substitute equ (3) into equ (2): $$-\frac{\hbar^{2}}{2m} \nabla^{2} \Psi(r,t) + V(r) \Psi(r,t) = E \Psi(r,t)$$ .........(4) Recall that the well known Planck-Einstein relation is given by: $$E = hv$$ ...........(5) And also, the reduced Planck's constant is given by: $$\hbar = \frac{h}{2\pi}$$ ................(6) Also recall that time dependence is given by: $$\phi(t) = C_+ exp(-i2\pi vt) + C_- exp(i2\pi vt)$$ ..........(7) Substituting equ (6) into (5), we have: $$V = \frac{E}{\hbar 2 \pi}$$ ..........(8) Substitute equ (8) into equ (7) $$\phi(t) = C_+ exp(-i2 \pi \frac{E}{\hbar 2 \pi} t)  + C_- exp(i2 \pi \f...

Schrodinger equation as a law in physics

The unified theory of wave-particle duality has been used to derive the Schrödinger equations. The Schrodinger equations are generally accepted, by postulate rather than derivation, to be laws of physics. The Schrodinger equations provide a basis for analyzing many kinds of systems (molecular, atomic, and nuclear) in a particular inertial reference frame. The success of the Schrödinger equations constitutes a basis for accepting them, their derivations, and the unified theory of wave-particle duality which makes such derivations possible. This acceptance is completely justified in the favored inertial reference frame. In accord with the principle of relativity, all physical laws must be the same in all inertial reference frames, i.e., all physical laws must be Lorentz invariant. Recall, the relationship: $$\nabla^{2} \psi = \frac{\partial^{2} \psi}{\partial t^{2}}$$ ...........(1) Equ (1) is Lorentz invariant and reduces, by means of the procedure presented in the previou...