php

How to design a Website Dashboard ?

Hello Are there any design examples of Website Dashboard showing Sales Statistics ? ...

regular expressions to replace money pattern

I would like to ask for help with this, I wanted to check for a string matching a decimal followed by a letter (15M, 15.3M, 15T or 15.3T) and replace it with zeroes. Like these: 15M -> 15000000 15.3M -> 15300000 15T -> 15000 15.3T -> 15300 I tried doing this with str_replace but can't get it right. Hope someone can help me. ...

cache or not to cache

I have an ajax application where the client might lookup bunch of data frequently(say by key stroke), the data gets updated on the server side once or twice a day at fixed times by a demon process. To avoid visiting the server frequently, I store the data in a xml file, so the client downloads it once when the page first loads, then loo...

How to append a path to PHP's include_path in .htaccess

Currently on my site I'm using statements like: include 'head.php'; include '../head.php'; include '../../head.php'; depending on how many nested folders deep I am. I'm sure there is a better way to do this. I'm convinced .htaccess is the solution, but I'm not sure how to go about implementing it. If I insert: php_value include_path...

How to retrieve the Mobile Number field value in my CakePHp controller..

Hi, I had created a input fields in the View Page like <div class="input text"> <label for="2">First Name (required) </label> <input type="text" value="" style="width: 300px;" id="2" class="required" name="First Name"/> </div> <div class="input text"> <label for="5">Emailid</label> <input type="text" value...

How do i get the javascript status of any browser?

hi friends, I want to get the javascript status of any browser. How do i get this.? Means when page load it should display that javascript in that browser is enable or disable. I m using php. Thanks In advance...... ...

Does anyone have a PHP snippet of code for grabbing the first "sentence" in a string?

If I have a description like: "We prefer questions that can be answered, not just discussed. Provide details. Write clearly and simply." and all I want is "We prefer questions that can be answered, not just discussed." I figure I would search for a regular expression, like "[.!\?]", determine the strpos and then do a substr from the ...

insert image to RTF file using PHP

How can I insert an image to an RTF file. Inside the RTF file there is a placeholder text like {photo}. I want to place the image at this position using php. ...

How to identify a PHP variable is an array or not

Hi, How to check whether the PHP variable is an array? $value is my PHP variable and how to check whether it is an array? ...

How do I create a variable in PHP of today's date of MM/DD/YYYY format?

How do I create a variable in PHP of today's date of MM/DD/YYYY format? I need to input that date as a hidden form field when someone comes onto the site. So I would need to grab today's date and convert it into that format. Thanks. ...

change image

how can we randomly change image when we refresh the page every time in php ...

How can I convert language of a div?

I am recently working in a project. There I need to convert language from English to Japanese by button click event. The text is in a div. Like this: "<div id="sampletext"> here is the text </div>" "<div id="normaltext"> here is the text </div>" The text is come from database. How can I convert this text easily? ...

Printing the Categories and Sub Categories Alone

function build_list($id=0,$collapsed="") //return an array with the categories ordered by position { $RootPos = ""; $this->c_list = array(); if($id != 0){ $this_category = $this->fetch($id); $positions = explode(">",$this_category['position']); $RootPos = $positions[0]; } // lets fetch the root categories $sql = "SELECT *...

Enable php5-curl on OpenSuse with Nginx

Hello, I have OpenSuse Server 10.3 with nginx for web server. I need to enable php5-curl. Installed it successfully. Then restarted web server, but nothing changed. Any ideas? Thank you ...

Is there a PHP5 setting to make it copy objects by value?

I got stuck moving an old website written in php4 to my company's new server that only supports php5. In php4, objects were copied by value, but in php5 it's by reference. Unfortunately for me, the person originally who wrote this site was making objects from others left and right, and now it's causing all sorts of problems. Is there ...

problem with oracle application server running slow

problem with oracle application server running slow in som web application like php web applications .. ...

convert language of a div

I am recently working in a project. There I need to convert language from English to Japanese by button click event. The text is in a div. Like this: "<div id="sampletext"> here is the text </div>" "<div id="normaltext"> here is the text </div>" The text is come from database. How can I convert this text easily? ...

Using $this, self::, parent:: for code readability.

I would like to know if it is acceptable/preferred to use self::method() and parent::method() when working in php classes. You can use $this->method() but $this-> can also refer to a class variable, a parent class variable, or a method from the parent class. There is no ambiguity in self:: Is self:: depreciated and/or are there any ca...

export csv in zend framework

Hi there, I'm trying to export a database table as a .csv downloadable from the browser. My code is zend framework based and I'm almost there with the following action: public function exportTableAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $fileName = $this->_getParam('f...

Regular Expressions: how to do "option split" replaces

Hello, those reqular expressions drive me crazy. I'm stuck with this one: test1:[[link]] test2:[[gold|silver]] test3:[[out1[[inside]]out2]] test4:this|not Task: Remove all [[ and ]] and if there is an option split choose the later one so output should be: test1:link test2:silver test3:out1insideout2 test4:this|not I came up with (...