1<?php ob_start();?>
2<div>Contents goes <b>here</b></div>
3<?php $contents=ob_get_clean();?>
4
1<?php
2 //can also use print instead of echo and would return but it is
3 //slower so use echo mainly
4 #variable rules
5 /*
6 - Prefix with a dollar sign $
7 - Start with a letter or an underscore only
8 - Only letters, numbers and underscores
9 - Case sensative
10 */
11
12 #DATA TYPES
13 /*
14 Strings
15 Integers 4
16 floats 4.4
17 Booleans True or Flase
18 Arrays
19 Objects
20 Null
21 Resources
22 */
23 $output = ' Hello there Bob!!';
24 $num1 = 4;
25 $num2 =10;
26 $sum = $num1 + $num2;
27 $string1 = ' Hello';
28 $string2 = 'Bobby!!';
29 $greeting = $string1 .' '. $string2;
30 $greeting2 = "$string1 $string2";
31
32 $string3 = ' They\'re Here';
33
34 #making a constant
35
36 define('GREETING', ' Hello Everyone!!');
37
38 echo $sum;
39 echo $output;
40 echo $greeting;
41 echo $greeting2;
42 echo $string3;
43 echo GREETING;
44?>