Adding CSS style in php script

<?php


       echo '<span style="font-size:10px">';    // add  styles as  style attribute
       echo 'test';
       echo '</span> ';
       echo '<p style="font-size:20px">';
       echo $title    = $_POST['text'];
       echo "</p>";
      

?>


In PHP, all variable names begin with a dollar sign ($). The $ is followed by an
 alphabetic character or an underscore, and optionally followed by a sequence of
 alphanumeric characters and underscores. There is no limit on the length of a
variable name. Variable names in PHP are case-sensitive. Here are some examples:

$k
$cot
$Sar_name
$_MPS

In PHP, unlike in many other languages, you do not have to explicitly declare variables.
 PHP automatically declares a variable the first time a value is assigned to it.
PHP variables are untyped; you can assign a value of any type to a variable.

PHP uses a symbol table to store the list of variable names and their values.
There are two kinds of symbol tables in PHP: the global symbol table, which stores
the list of global variables, and the function-local symbol table, which stores the
set of variables available inside each function.


 Dynamic Variables
Sometimes it is useful to set and use variables dynamically. Normally, you assign a variable like this:

$var = "derro";
Now let's say you want a variable whose name is the value of the $var variable. You can do that like this:

$$var = "Jinna";
PHP parses $$var by first dereferencing the innermost variable, meaning that
$var becomes "derro". The expression that's left is $"hello", which is just $derro.
 In other words, we have just created a new variable named hello and assigned it
the value "Jinna". You can nest dynamic variables to an infinite level in PHP,
although once you get beyond two levels, it can be very confusing for someone who
is trying to read your code.

Related Posts:
  • Aarray And multiple array values Aarray And multiple array values array[key_element1] => array(1, 2,3); array[key_element2] => array(4, 5, 6);  associative arrays array[key1] => array(key => value1, key => value2, key => value3); … Read More
  • PHP RSS feed script PHP RSS feed script RSS Reader PHP code function get_feed($link) {     $this->load->helper('text');     $last_update = time();     header('Cache-Control: no-cache, must-… Read More
  • Static Methods-PHP  PHP supports declaring methods as static. Whatthis means is that your static methods are part of the  class and are not bound to any specific object instance and  its properties. Therefore, $this isn’t acce… Read More
  • strtotime php-current time zone strtotime()parsing is always done with the current time zone, unless a different time zone is specified in the string that is parsed:<?phpecho date("H:i T\n", strtotime("09:22")); // shows 09:22 CETecho date("H:i T\n\n", … Read More
  • How to Read an RSS Feed With PHP <?php include("../includes/config.php"); include("../includes/dbcon.php"); $tt_res=mysql_query("SELECT * FROM `rss_data`"); $num = mysql_num_rows($tt_res); if($num!=0) { $tt="TRUNCATE TABLE `rss_data`"; mysql_query($t… Read More
  • PHP Session expire-minutes inactivity PHP Session expire-minutes inactivity session_cache_limiter('public'); session_cache_expire(15); //should expire after 15  minutes inactivity asy way to handle this, is to set a variable to $_SESSION  every time … Read More
  • Top codeigniter interview question and answers codeigniter interview question  What is codeigniter? Codeigniter is open source , web application framework.Its is for building websites using php.Codeigniter is loosely based on MVC pattern.Most simple framework in ph… Read More
  • Mysql Join query Codeigniter Mysql Join query Codeigniter code loads and initializes the database class based on your configuration settings. $query = $this->db->query('SELECT name, title, email FROM my_table'); foreach ($query->result() … Read More
  • Php Session Security-Internet Security Because a session may contain sensitive information, you need to treat  the session as a possible security hole. Session security is necessary to  create and implement a session. If someone is listening in or sno… Read More
  • PHP INTERFACES Class inheritanceenables you to describe a parent-child relationshipbetween classes. For example, you might have a base class  Shapefrom which both Squareand Circlederive. However,  you might often want to add a… Read More
  • PHP-final METHODS-override a final method However, there are times where you might want to make sure that a method cannot be re-implemented in its derived  classes. For this purpose, PHP supports the Java-like final access modifier for methods that declares … Read More
  • parent AND self PHP oops  parent  AND self PHP oops self::refers to the current class and it is usually used to accessstatic members, methods, and constants. parent::refers to the  parent class and it is most often used when wanting … Read More
  • What is array Arrays An arrayin PHP is a collection of key/value pairs.  This means that it maps keys or indexes to values. Array indexescan be either integers or strings whereas values can be of any type. Arrays in PHP are implement… Read More
  • download a file by php code-PHP download files code Basic example for download a  file by php <?php $file="http://testexample.com/your_test_file.jpg"; // path to your file  header('Content-Type: application/octet-stream'); header('Content-Disposition: attachm… Read More
  • Create Login page php-Php code  Create Login page php <?php             session_start();             $host="localhost"; // Host name &n… Read More