Sunday, September 16, 2012

codeigniter Deprecated error and A PHP Error was encountered [SOLVE]


Deprecated: Assigning the return value of new by reference is deprecated in D:\xampp\htdocs\hes\system\codeigniter\Common.php on line 123
   SOLVE to replace -> $objects[$class] =& new $name(); to $objects[$class] = new $name();
Deprecated: Assigning the return value of new by reference is deprecated in D:\xampp\htdocs\hes\system\codeigniter\Common.php on line 129
 SOLVE to replace ->  $objects[$class] =& new $name(); to $objects[$class] =new $name();

  A PHP Error was encountered

Severity: 8192
Message: Function set_magic_quotes_runtime() is deprecated
Filename: codeigniter/CodeIgniter.php
Line Number: 60

SOLVE to replace - set_magic_quotes_runtime(0);  to ini_set("magic_quotes_runtime",0);

then restart your web server application.,.,.

A PHP Error was encountered

Severity: 8192
Message: Assigning the return value of new by reference is deprecated
Filename: libraries/Loader.php
Line Number: 248

SOLVE to replace -     $CI->dbutil =& new $class();  to     $CI->dbutil = new $class();

A PHP Error was encountered

Severity: 8192
Message: Assigning the return value of new by reference is deprecated
Filename: database/DB.php
Line Number: 112

SOLVE to replace -    $DB =& new $driver($params);  to  $DB = new $driver($params); 
then restart your web server application.,.,.

powered by amazon

count number of word from a string in php

<?php
$str = "extract word from a sring using php";
//before
$extractword= str_word_count($str);
$extword=explode(" ",$str);
//count word from string
echo count($extword);
echo "total word in a string is =$extractword<br>";
// after
$couter=1;
foreach($extword as $word){
echo "$couter  ".$word."<br>";
$couter=$couter+1;


}
?>