php5

PHP code causing "deprecated" error in PHP 5.3

The following code causes a 'deprecated' error in PHP 5.3... Is there a substitute for it? $this->widgets[$widget_class] = & new $widget_class(); ...

Pass an object into another class by reference

I did see this question but it doesn't fully answer the question I have. If I do this: $obj1 = new ObjectOne(); and then this: $obj2 = new ObjectTwo($obj1); $obj2->someFunction(); Where someFunction() modifies the attributes of the object passed into it, will both $obj1 and $obj2->passedInObject both in effect be updated? ...

PHP form enter will not give me the text fields.. [http-auth login for security]

<?php $prev_path = "./../../."; $dont_redirect = true; require_once "${prev_path}./config.php"; session_start(); function http_digest_parse($txt){ $needed_parts = array("nonce"=>1, "nc"=>1, "cnonce"=>1, "qop"=>1, "username"=>1, "uri"=>1, "response"=>1); $data = array(); $keys = implode("|", array_keys($n...

How can I sort a multidimensional array using php?

Hi I have to sort this array in desc. order on the basis of ratingVal using php. How can I do that. Array ( [0] => Array ( [rating_postid] => 26 [raCnt] => 6 [sRate] => 18 [ratingVal] => 3 ) [1] => Array ( [rating_postid] => 714 [raC...

A newbie's question

Hello Guys, I have a little newbie's hitch. I have got something like this: // Assign Device ID if ($line == "IMEI 358998018395510\r\n"){ $device_id = 1; }elseif($line == "IMEI 352924028650492\r\n"){ $device_id2 = 3; } ........ ........ if (fwrite($outFile,$device_id or device_id2. ",". $date.",".$line)===FALSE){ I want to be a...

How slow is gzuncompress?

I'm working with a very simple filesystem database in order to benefit from performance. Unfortunately, the trade-off is disk space. I'm thinking about compressing data everytime I write and read from the filesystem database using gzuncompress and gzcompress. How slow are those functions? Can they be used without affecting my system perf...

PHP5 and lib GD: out of the box support?

Does php5 come with the GD graphics library as standard? http://www.libgd.org it mentions a version of php4 on their site - do I assume every version since then has it built in? ...

How do i Loop through the hidden field items and put in Session using PHP

Iam having hidden field which contains the value in this format ENO:123,EQNO:231,loc:CHICAGO;ENO:567,EQNO:898,loc:FLORIDA; In the above line iam having two pair of records separated by ";" and for each record iam having three columns separated by ":" Now How Do i loop through this and put each column in session ...

Should i learn php 5 or php 6?

I'm not sure how popular php 6 is and if many webhost even support it, so basically learn php 5 first or just straight to php 6? Thanks in advance. ...

Share a Kohana install between sites.

Hey all, kind of new at Kohana and I have a quick question. I have a site where there will be three subsections, organized by subdomain (i.e. admin.site.com, community.site.com, www.site.com) but each of the subsections will be pulling from the same database so should be sharing the same models. Is there a way to organize it so that I c...

How do I iterate through this loop Get each Item Separately

I have this array I want to get the Values "ABC" ,"1","2" and so on respectively and store them in separate variables. I have used nested foreach but could not get it array(2) { [0] => array(3) { [0] => string(10) "ABC" [1] => string(1) "1" [2] => string(2) "2" } [1] => array(3) { ...

how to fetch custom google search results by simple html dom parser ?

Hi I have custom google search included on a html page. like http://www.*.com/search.htm?cx=partner-pub--00000000000-c77&amp;cof=FORID%3A10&amp;ie=ISO-8ds3-1&amp;q=software&amp;sa=Search&amp;siteurl=www.*.com%2#1342 When I am using same url in browser i get results. I want to call it by simple dom html parser then it is returning blank...

Cache invalidation on content update

Hi , i understand basic concept of cache , but one thing i cant able to understand , even i saw some example , assume , my first request is 9am , now new update information coming to cache , then another same content request from other user , now system get content from cache file instead of DB, example 1 : i set the cache expire ...

How to get the parameter sending by post method in php included file?

Hi friends, Good day. I am having the following code snippet in init.php. <?php include_once("config.php"); include_once(__SITE_PATH . 'view/' . $_REQUEST['page'] . EXT); $loginobj = new $_REQUEST['page']($_REQUEST['billingentitynuber']); $text = $loginobj->$_REQUEST['content'](); echo $text; ?> In Jquery I am having the function Jqu...

Insert image in xls sheet throgh php code.

Hello All, Greetings !! I have to insert a logo(image) on the row[0],column[0].I am using "Spreadsheet_Excel_Writer" for that.i tried its insertBitmap() methode ,program working fine but it doesn't show the bitmap image on xls sheet,instead blank row. what could be reason ? can you please let me know the exact string format...

how to pass value to querystring in php?

i want to pass a uid to next page through querystring.how i pass it and how i get it on next page? ...

Zend_Cache: After loading cached data, character encoding seems messed up

Hi all, First; On my development server (localhost; default XAMPP on OSX) everything works fine, though when I deploy the exact same code (and data) to the staging server (managed Apache2 on Redhat) it breaks. I'm caching some data using Zend_Cache using the File backend and auto-serialization. Special characters used in the original d...

MySql or PHP function to convert longitude and latitude to decimal degrees.

Hello, I have spent sometime researching the forum and other places to resolve this but yielded nothing and I have decided to ask. I have log files containing NMEA sentences. I have stored this sentences which are in hundreds of thousands in mysql database. I have stored the longitudes and latitudes as double datatype. I want to conver...

How bad is mb_internal_encoding("UTF-8"); ??

Hi , After Answering this question http://stackoverflow.com/questions/4041968/zend-cache-after-loading-cached-data-character-encoding-seems-messed-up/4043064#4043064 I use it to change the PHP's internal encoding , its originally ISO-8859-1 , so i need to change the encoding of every none English input value , bu using it i force ...

How to correct the Flaw in this function

How to correct the Flaw in this function class MyClass { private $_callingscript; public function __construct(){ $this->_callingscript= basename($_SERVER['SCRIPT_NAME']); } public static function Setvalue($k,$v){ if (!empty($k)) { $_SESSION[$this->_callingscript.'_'.$k]= $v;//This doesnot wo...