PHP usage in JavaScript
<script type="text/javascript">
<?php $count=0; ?>
for(var i=0;i<10;i++)
{
<?php echo "Value of Counter".$count;?>
<?php count++; ?>
}
</script>
Added to PHP by Srikanth Rayabhagi
str_split function for PHP 4
function str_split($str) {
$str_array=array();
$len=strlen($str);
for($i=0; $i<$len; $i++) {
$str_array[]=$str{$i};
}
return $str_array;
}
Added to PHP by Ben Palmer
Get Gravatar Pic
<?php
$gravatar_link = 'http://www.gravatar.com/avatar/' . md5(<<**SelectionInsertionPlaceholder**>>) . '?s=32';
echo '<img src="' . $gravatar_link . '" />';
?>
CI Controller
<?php
class <<**SelectionInsertionPlaceholder**>> extends Controller {
function <<**SelectionInsertionPlaceholder**>>() {
parent::Controller();
$this->load->model('<<**SelectionInsertionPlaceholder**>>s'); // Load Model
}
function index() {
$data['title'] = '<<**SelectionInsertionPlaceholder**>>';
$data['heading'] = '<<**SelectionInsertionPlaceholder**>> List';
$data['query'] = $this-><<**SelectionInsertionPlaceholder**>>->get();
$this->load->view('<<**SelectionInsertionPlaceholder**>>_list', $data);
}
}
?>