Array(0= blabla
1 = blabla
2 = blblll) etc..
Is there a way to change all the numeric keys to "Name" without looping through the array (so a php function)?
I need a similar function in PHP for this JavaScript function
text = text.replace(/ffc/g, "Hello");
I think preg_replace will do, but i'm not sure how to write the expression..
I was looking at this post, and it is close to what I need:
http://stackoverflow.com/questions/1669165/php-how-to-count-60-days-from-the-add-date
However, in that post, the calculation is performed by adding 60 days to the current date. What I need to do is calculate the date based on a variable date (and not the current date).
Something like this:
$my_date = $some_row_from_a_database;
$date_plus_10_days = ???;
Anyone know how to do that?
Thanks
I'm a PHP developer looking to speed up my production time, and add a new ability to my CV.
I'm after a package that provides the basic CMS features that I can build on for a wide range of purposes.
I've heard of PHPcake, Drupal ect but I don't know enough about these to make an informed decision. What alternatives are there? Are they OO, MVC, producedual? If you could point me to some comparisons or give your option of which actually work.
Afternoon,
Bit of a tricky question this one, I have a website and need to translate the pages into french, I am using google translate API to do the translation. What I am doing is loading in the HTML templates into a string using PHP and then need to translate the text copy on the pages and then save as for example:
fr_master_header.html
de_master_header.html
The problem I have is identifying the text copy on the page ignoring the HTML, replacing the copy in the extact place and then saving the file with the HTML tags and trasnlated text copy.
Cheers in advanced.
In your opinion, which PHP CMS has the best architecture? I don't care about how easy its admin panel is to use, or how many CMS features it has. Right now, I'm after how good its code is (so, please, don't even mention Drupal or Wordpress /shudder). I want to know which ones have a good, solid, OOP codebase.
Please provide as much detail as you can in your replies.
My site is requesting a remote image which is being transferred with the wrong MIME type. I was wondering how might I override it in PHP to tell it that it's an image? I can't use header('Content-Type') because the image is being used in a HTML document.
http://manga.justcarl.co.uk/N/Naruto/494/1 - one of the pages attempting to request an image... the image looks broken because it's trying to output it as html
code is in a static class in an external file eg. /home/test/public_html/fg2/templatecode/RecordMOD/photoslide.mod
how do I load this into my script on demand, and be able to call its functions ?
I am a novice at php , so please explain your code.
help is appreciated.
Jer
hello, i'd like to know if there is an editor that has php code completion and has a fullscreen (not the way komodo edit or notepad++ have) like gedit. I've been searching for some but couldn't find any :/
thanks
Im trying to find how to take a page request such as http://www.domain.com/sam/?dog=woof&cat=meow and send it to http://www.domain.com/animals.php?dog=woof&cat=meow
Ive tried a few things ive found on here, or i adapted them i should say, but i keep getting either nothing, or infinite loops.
Any ideas?
For those of us who use standard shared hosting packages, such as GoDaddy or Network Solutions, how do you handle datetime conversions when your hosting server (PHP) and MySQL server are in different time zones?
Also, does anybody have some best practice advice for determining what time zone a visitor to your site is in and manipulating a datetime variable appropriately?
Is there a way to define a function in PHP that lets you define a variable amount of parameters?
in the language I am more familiar with it is like so:
function myFunction(...rest){ /* rest == array of params */ return rest.length; }
myFunction("foo","bar"); // returns 2;
Thanks!
Hi,
I recently moved my website to a new host and now am experiencing some broken code..
I have an uploading script that is now returning this:
move_uploaded_file() failed to open
stream: Permission denied in *..
I've set the upload directory to 777 which worked fine, but my script is needed to have top level permissions..
(As the script itself sets permission to directories, does lots of copying etc)
Is there a way in apache I can set the PHP script to the owner of all the folders on my server?
Thanks
Hi, I have some errors in my output source code, I'm wondering if there is a tool that is able to look through the site and find which .tpl file my error is in? That, or at least give me a list of .tpls to look through. I can't seem to find this error and the site isn't very well documented. I'm not the best PHP programmer, I'd be looking for an online resource or something pretty simple.
Thanks very much.
Is there any class for it i found some classes but they were old so not working.
I need a code snippet or a class for getting msn contact list with username and password.
And is it possible sending mail via msn instead of php's mail function
I'm developing a simple web application where in I need to display number a to my users in string format.
Example:
12 - One Two or Twelve
-20 - minus Two zero or minus twenty
Either way is fine. I need this to be done in PHP. Any help will be appreciated.
I want to express the date in PHP as "May Fourteenth Two-thousand and ten", any ideas? Extra but not necessary would be the time like "Eight forty-eight PM"?
Currently my MySQL data stored like below
product | total
------------------------------------------
puma,adidas | 100.00,125.00
puma | 80.00
reebok,adidas,puma | 70.00,100.00,125.00
adidas,umbro | 125.00,56.00
How to combine, explode, merge and total it like this in php?
puma 485.00
adidas 350.00
reebook 70.00
umbro 56.00
Is it possible to create a PHP function that takes a variable number of parameters all of them by reference?
It doesn't help me a function that receives by reference an array of values nor a function that takes its arguments wrapped in an object because I'm working on function composition and argument binding.
Don't think about call-time pass-by-reference either. That thing shouldn't even exist.
Trying a bit of AJAX, and I find that much of my data is littered with underscores!
Documentation confirms that this is working as intended. Any way to pass my form information to PHP in tact? I'm using code igniter, so my pass looks like /controller/function/variable,
receiving controller:
controller{
function($v=0){#what once was hello world is now hello_world...}
}
I can't very well do an undo, data might contain an underscore.
Thanks,
Brandon