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..
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
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"?
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!
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 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.
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?
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 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
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
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.
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.
Hi, is it possible to detect if flash is installed using PHP. My aim is, that if it is installed it will play a flv file, and if not it will use another player eg; quicktime? If it is possible how do I go about doing it?
Thanks
Tom
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
Hi, I'm creating a PHP web app, and I want to make it secure, fast and scalable. At the start, I'm using a Shared Hosting, but I'm planning movimg to a VPS. Can you suggest me some tips, please?
Is there php function to remove the space inside the string? for example:
$abcd="this is a test"
I want to get the string:
$abcd="thisisatest"
How to do that? thanks.
Hi,
I have a web on php5, iis6, and Oracle on windows server 2003.
I had Oracle 10.2.0.1.0 and deinstalled it. After that I installed earlier version (10.1.0) for cloning DB purposes, php doesn't work. As I understand it failes because of oci8.dll, but can't find the real problem.
Please, help.
I use this to pull values from a custom field with several values:
<?php $mykey_values = get_post_custom_values('services');
foreach ( $mykey_values as $key => $value ) {
echo "<li> $value</li>";
} ?>
I want to sort the output according to the way I have set up the values in the key (alphabetically)
Looking around, there are plenty of options available for form management in PHP from several frameworks: Zend, CakePHP, CodeIgniter, Symphony, and probably several others offer solutions. All else being equal, which set of form classes do you prefer? What makes any of these better than the others?
Which one is the best XMPP client library for PHP/javascript?
I have gone through many of these like:
JSJaC
XMPPHP
MISSUS
Kaazing Gateway
Some one having experience in using these will have better idea.