php

Is there any technique to convert a image in to real text which is copyable

I have scanned a page of a book and saved it as a picture. How do I convert that image into real text? Is there any technique for that? Any help will be highly appreciated. ...

PHP/JS: How to implement dynamic breadcrumbs? (multi-window/tab compatible)

Hi, I'm working on a site where we need "dynamic" breadcrumb generation. Pages within this application are not specific children of the other, so when the user is browsing one of them, I can't simply retrace steps back up. I could have the following breadcrumbs-like lists: (updated) * inbox > message > user profile * search results ...

multidimension array

Hi, I want to create a multidimensional array based on a string. the string has value $string="1/2/3" and i want to assign $array[1][2][3]=somethimg actually the index of the array are described inside the $string The $string has not same depth. For example may be $string="1/2 OR $string="1/2/3/4/5 OR $string="1/2/3/5/7/8/9/9/6 so...

Is it possible to use php includes to integrate Mint (haveamint.com) into my CMS?

I am currently running a custom CakePHP CMS and I would like to have a .php page which will basically use php includes for Mint from haveamint.com which is also written in PHP. Can I use php include to basically do a nicer version of an iframe inside my cms? ...

php while in edit mode show selected value in to drop down

Hi , This question asked already but my question is very simple, in the my accont page, i have the employee country in dropdown, How to make selected value in combo , when in edit mode, Thanks ...

Better performance or better structure

Better performance: list($result1,$result2,$result3,$result4)=get_all_result(); The number of total sql queries are fewer,and performance is a bit better.But it's hard to reuse. Better structure: $result1=module1_get_result(); $result2=module2_get_result(); $result3=module3_get_result(); $result4=module4_get_result(); It'll need m...

Creating Mock object of Interface with type-hint in method fails on PHPUnit

I created the following interface: <?php interface Action { public function execute(\requests\Request $request, array $params); } Then I try to make a Mock object of this interface with PHPUnit 3.4, but I get the following error: Fatal error: Declaration of Mock_Action_b389c0b1::execute() must be compatible with that of Action::e...

Combined Data from 2 Domain Models

Hello everyone, im trying to implement the Data Gateway / Domain Pattern. I understand the basics and its a fantastic pattern to separate domain logic from the persistent data layer. Now i have following requirement: Lets say i have 2 domain-models: User(s) and Company(ies). When i wanna retrieve a user list with all users, i would do ...

Polymorphic / Plugable PHP Classes

I have a question which is sonewhat more of a design question. I have a class which defines a bunch of functions. However, I want that the behaviour of some functions are changeable during runtime - or at least working like a plugin interface during design time. eg: class MyClass { public function doSomething(); } $obj = new MyClas...

HTML list to array

How can I parse multilevel HTML list and get an array by php ...

I need suggestions on C2C (Customer2Customer) PHP CMS

I need to build a website for customers advertising such as craiglist. I want to build it in PHP, and I 'm willing to use an open source CMS. I'm a very big fan of Drupal, but I don't now if stands well for this kind of sites. Could anyone suggest me a suitable CMS for my domain? Best, Demian ...

IE display error in prototype.js line no. 1597

i m using lightwindow using prototype.js, IE display error when lighwindow appear, i m writing lines where problem occur, please suggest me where is the error and how to rectifi it setStyle: function(element, styles, camelized) { element = $(element); var elementStyle = element.style; for (var property in styles) if (...

MySQL Insert on Duplicate Key.

I am building a rating system, and i want to insert a new row, if the name field does not already contain the name i want to insert, and if it does exist, i want to increase the count field by 1 For example, if i have a row the the name 'Tom' and i try to insert another row with the name 'Tom, then i want to +1 for the field count on th...

Firefox displays incorrect value for php strlen function on variable

I have a variable that I am calculating the length of and in all browsers except FF (IE, Chrome, Safari) the value is 0. However in FF, the value is 65 (see screenshot - value beneath photograph) screenshot Link to site page I have cleared my cache with cc cleaner and using the clear cache option in FF itself. The code I am using wo...

How to use Doctrine and what does it represent with ORM and PDO

Doctrine: Doctrine is an object relational mapper (ORM) for PHP 5.2.3+ that sits on top of a powerful database abstraction layer (DBAL). One of its key features is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL), inspired by Hibernates HQL. ORM: Object relational m...

Exporting MySQL to Excel

Hi, I need some help with this code from PHP Classes, that's supposed to export MySQL to Excel. I'm getting the following error: Parse error: syntax error, unexpected T_SL in excelwriter.inc.php on line 100 This is line 100: [Line100] function GetHeader() { $header = <<<EOH <html xmlns:o="urn:schemas-...

MySQL: Two foreign keys in one table referring to another table

Hi, I've come across something that seemed simple before but has me scratching my head again. I have a table for users: user_id (PK) | username| email | something ... and a table for "views" for when one user has viewed another user: view_id (PK) | viewer_id | viewed_id | view_date The "viewer_id" and "viewed_id" are both user_ids,...

Open Source PHP script/lib/cms for creating sites a-la StackOverflow?

I want to create site a-la StackOverflow but for different needs (not for Questions at all) (for some crazzzy geo mapping project=) so I need CMS... I vant it to be looking like StackOverflow... So is there any Open Source PHP script/lib/cms for creating sites a-la StackOverflow? ...

change path for include/require only once

I have a lot of sites - all hosted on my server. I want one of them to access file from /vhost which is a directory above httpdocs where the domain is linked. I know that there is an option to change the path in httpd.conf but that is a lot of work to change all the includes in my sites. ...

Check if a browser supports a specific MIME type?

How can i check if the browser supports a specific mime type with php? ...