I am using PHPs GD extension for jpg image manipulation. The problem is that at one point I am using the getimagesize function to get image width and height. It works fine locally as well as one one of my remote servers but not on another of my remote servers. The problem seems to arise when using getimagesize for relatively large images...
Hello everyone, I have a problem with using Zend framework (for YouTube data API). I created very simple PHP script for uploading YT videos using this API and it works almost everywhere - I tried it on 3 different machines (both Linux and WinXP). But after intalling it to 4th machine, I got this error:
Error: inet_pton() [function.inet...
I need a quick overview to figure out if it's worth switching from PHP to ruby. Please list some differences you know. I'm just talking about PHP and Ruby, not Ruby on Rails (that would be a bad comparison).
...
I'm currently implementing memcached into my service but what keeps cropping up is the suggestion that I should also implement APC for caching of the actual code.
I have looked through the few tutorials there are, and the PHP documentation as well, but my main question is, how do I implement it on a large scale? PHP documentation talks ...
I'm looking for a tool to draw good-looking Venn diagrams, for use on a Linux-based PHP site, which already employs Flash for graph drawing (Open Flash Chart 2). Free (as in beer or speech) would be nice, but isn't essential.
So it should be one of the following (in my rough order of preference):
Browser based (Flash)
PHP library
Lin...
In Zend framework, using the MVC, if A user surf explicitly to http://base/url/index.php instead of just http://base/url, The system thinks the real base url is http://base/url/index.php/ and according to that calculates all the URLs in the system.
So, if I have a controller XXX and action YYY The link will be
http://base/url/index.php/...
Hi everyone, long time listener. First time caller...
Not strictly a PHP question as it involves regular expressions but this one has got me tearing my hair out.
I have 3 regular expressions that I want to create, and only one is working correctly.
Now I am not sure whether this is due to the fact that:
I don't understand preg_match...
When I run this code:
foreach ($tree as $node) {
echo str_repeat(' ', $node->tree_depth * 4) . $node->id . PHP_EOL;
}
I get well formatted text like:
Food
Fruit
Red
Cherry
Strawberry
Cool
Not cool
Yellow
Banana
Meat
Beef
Pork
But I want to create a list with <ul><li>......
I want to check if a variable has a number in it, I just want to see if there is one I don't care if it has any thing else in it like so:
"abc" - false
"!./#()" - false
"!./#()abc" - false
"123" - true
"abc123" - true
"!./#()123" - true
"abc !./#() 123" -true
There are easy ways of doing this if you want to know that is all numbers bu...
Hello!
I have the following PHP function to calculate the relation between to texts:
function check($terms_in_article1, $terms_in_article2) {
$length1 = count($terms_in_article1); // number of words
$length2 = count($terms_in_article2); // number of words
$all_terms = array_merge($terms_in_article1, $terms_in_article2);
...
I am new to regex in PHP and understand the basic patterns however the ones below are a bit complex and I don't understand what the following pattern matches:
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#... "<a href='' rel='nofollow'></a>", $ret);
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[...
I have a project that is currently all over the place and i'm thinking of making it MVC.
The problem is that the system is currently being used and I can not change the interface (It's in frames :s) Also there are certain things that I will need to handle myself such as password generation, login and user levels.
I already have the mod...
Is there anyway to compare arrays in php using an inbuilt function, short of doing some sort of loop?
$a1 = array(1,2,3);
$a2 = array(1,2,3);
if (array_are_same($a1, $a2)) {
// code here
}
Well you get the idea :D
...
Hello,
I have this achor locating regex working pretty well.
$p = '%<a.*\s+name="(.*)"\s*>(?:.*)</a>%im';
It matches <a followed by zero or more of anything followed by a space and name="
It is grabbing the names even if a class or an id precedes the name in the anchor.
What I would like to add is the ability to match on name=' wi...
Here's the situation:
I'm using jquery.validate.js to validate my forms, but I need to add a server-side validation layer. jQuery Validate uses class names within form-elements to determine what it should do -- I want to fetch those class names into PHP so that I can perform the same validations on the server-side.
I'm hoping to do ...
I need to reset a MySQL Field value automatically at midnight. It is a specific column in a specific row in a table. I know how to do this in PHP but I do not know how to execute the PHP Script at midnight without someone having to do it themselves. Do you have any viable solutions?
Edit:--------------------
Preferably without using Cro...
I've gone through several tutorials in various languages (currently working my through the Agile Web Development with Rails book for an attempt at practical learning) and on their own, these tutorials don't seem to give a good big picture of development. You can learn how to write arrays, define variables and several other concepts but ...
Hi
I am wondering what other approaches you would take to do some simple string splitting in PHP. I am receiving a response from a SMS gateway where two of the interesting values are the code used and the users text message.
The code could be something like: Freetrip (lowercase, uppercase, mixed case)
The user message should in the be...
Hello,
I wanted to know if there is way to log the mysql queries in CakePHP being executed when we use the find method on the models, I know that rails database queries, so does Cake do the same, if so how can I enable it or use it?
Shiv
...
Hey everyone,
I am trying to use reCaptcha on my site, and recaptcha_challenge_field, and recaptcha_response_field are not being added to the $_POST array on the backend - but the rest of the variables from my form are.
Any ideas? I have double checked the public/private keys.
Here is the generated HTML:
<form action='myform.php' na...