php

php gdlib angle problem

I'm using php gd lib 5.2.13 and tried to make a picture with imagettftext ($image, $color and $font are defined of course). imagettftext($image, 12, 90, 10, 20, $black, $font, "This.is_a test 123"); //image, font size, angle, x value, y value, color, font, text As you can see I want the angle to be 90°. The problem is that the text is...

localhost/live - detect by HTTP_HOST

Hello, let's say I develop locally and debug small things on live server. Is it good idea to have something like this in my code? : $is_local = (strpos($_SERVER['http_host'], 'localhost') !== false); define ('DEBUG',$is_local); And then use it through my code, when setting stuff? $mysql_settings = (DEBUG) ? array(/*localhost set...

What does this code do? Recursive Iterator in php?

I'm working on a zend framework based email project and I'm following some code samples online.. I can't understand this line of code which apparently loops through different 'parts' of an email message. I have no idea how it works btw and suspect that theres some error taking place which my parser isn't showing right. foreach (new Recu...

PHP difference between shuffle and array_rand

Hi, What exactly is the difference between shuffle and array_rand functions in PHP? Which is faster if there is no difference. Thanks ...

How to get last full MS SQL Server error message?

I am aware of: SELECT @@ERROR but it will give me only an ERROR CODE (a number) and I need a full text message like: Cannot insert duplicate key row in object 'dbo.TABLE_NAME' with unique index 'IX_ID_unique'. The statement has been terminated. How can I do that in MS Sql Server 2005 ? EDIT: I need to acquire this error me...

symfony 2.0 stable enough to use?

i wonder if symfony 2.0 is stable enough to use? cause i never used symfony before. it seems that symfony 2 is much more better than the previous version and i dont want to relearn/recode everything some months from now. when do you think symfony 2.0 will be released? will it be a wise choice to use 2.0 now? ...

I want a function to remove numbers higher than 5000 in a string

I have a string that contains unwanted numbers ( any number higher than 5000 ) I want a php function to remove any number higher than 5000. thnx :) ...

PhpDoc. Parameterization of variables in Eclipse

Hi. I heared Eclipse doesn't support parameterization of variables like this: /** @var DBProxy */ $proxy; or /** @var Uri */ $uri = Registry::get('uri'); $uri->... But no completions available Is there any other solution? ...

removing phone number from a document.

Hi, I've got a challenge that I am hoping that the SO community is able to help me with. I trying to parse a lot of html documents in my PHP application to remove personal details, such as names, addresses and phone numbers. I can remove most of these details without too much trouble, however the phone number is a real problem for me....

Would it be quicker to make wordpress theme direct on FTP?

Would it be quicker to make wordpress theme direct on FTP? Because client want to see the progress and if I will work on local XAMPP then it would not be possible to update any changes quickly. How to setup theme development environment with any free and lightweight IDE for windows XP? ...

str_replace problem

I am trying to change title data into URL. I need to get rid off all text starting from "deadline" from the following dynamic data which I get from $title: New York deadline May 14th, 2010 (urgent) New Hampshire deadline May 19th, 2010 New Jersey deadline I expect the result should be like this new-york new-hampshire new-jersey Here i...

Multiple table relationships in Zend Help

Hi Guys I have been doing some DB mapping to link two tables to no avail. Everytime I run the code I get the following error: Message: File "Role.php" does not exist or class "Role" was not found in the file Stack trace: #0 C:\wamp\www\zend\library\Zend\Db\Table\Row\Abstract.php(867): Zend_Db_Table_Row_Abstract->_getTableFromString('R...

PHP Using session variables in array(s)

Hello, My question is how do i put these session variables into a array? I have tried countless ways but none of them work. Not really sure what to put in a array and what no and how to adress them. Currently when i fill in the form the data gets displayed in a table. Next when i press the hyperlink that takes me back to the same form,...

php - regex- preg_replace - space after line-break!

Hi all guys! still on regex! i want learn it but i'm still crashing the head into my keybord! ;-) ok very trivial for you, i'm sure! Assuming i have this sting, the \s is where the space actualy is... \n where linebreak is.. EDITED: OTHERFIELD: Other text here...`\n` DESCRIPTION: The quick brown fox jum`\s\n` `\s`ps over th...

How to load an ajax (jquery) request response progressively without waiting for it to finish?

I want to make a form that will use jquery to submit a list of keyword to a php file, this file could take a lot of time to load depending on the size of the keywords list. What I want to do is to load the php response into a div or container in real time without using iframes. All the ajax request I know have to wait until the request...

str_replace between two numerical strings

Another problem with str_replace, I would like to change the following $title data into URL by taking the $string between number in the beginning and after dash (-) Chicago's Public Schools - $10.3M New Jersey - $3M Michigan: Public Health - $1M The desire output is: chicago-public-school new-jersey michigan-public-health PHP co...

PHP Frameworks: Do any of them compare to Visual Studio?

Are there any coders out there that have real experience/exposure to both PHP and ASP.net? I'm a C# developer, wondering if any PHP frameworks compare to the robustness of the Visual Studio Development environment. ...

PHP CLI version issue

I am trying to use Zend Tool on my media temple Grid Server account. The problem is that the installed CLI version of PHP is 4.4.8 and Zend Framework needs PHP5. On an account basis its possible to choose PHP 4 or 5 but not so for CLI. Its possible to globally select to use PHP5 by using the extension .php5 but in the case of Zend Tool w...

What are the differences between mod_php and cgi php script?

What are the differences between mod_php and cgi php script? I mean, why it's better (is it?) to use mod_php instead simple php scripts, running them as CGIs? Thanks ...

Codeigniter Twitter Library : What is my Callback URL. Where can i find it?

I would like to know where i can find my callback url in ci? Im quite new to it so not really sure. Here is the lib im using. <?php class Home extends Controller { function Home() { parent::Controller(); } public function index() { // This is how we do a basic auth: // $this->twitter-...