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
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.
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?
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
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, 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
I have a Windows Application in C#. This application interacts with a remote mySQL database. Should I create a PHP web service to do these (insert/add/delete/update) or use mySQL connector for c#? I'm not sure which way is better.
Thanks!
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.
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)
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.
Possible duplicate:
http://stackoverflow.com/questions/433302/php-convert-a-string-to-variable
for example:
$test = array("this","is","a","test");
$what_array_to_read = "$test[0]";
function to read the array $test[0]
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.
Hi guys,
Probably, this question has been asked before, though, I'll ask it again.
Currently, I'm facing a problem with form encoding. When posting my form, all spaces are replaced by the "+" character. I would like to replace this "+" character by a real space.
Does someone has a PHP solution for this?
Thanks in advance.
Cheers, Lennart
I have been approached to create a website using Sabre Web Services to power the reservations system. All documentation I have seen refers to .NET or Java solutions, I was in doubt whether PHP can be used as access is performed using SOAP. I have found no further information about this, I assume the answer is yes, but wonder why there is not a single reference to this being possible - all solutions seem to be .NET
Any suggestions?
Thanks!
I'm trying to use facebook connect in my site so users can register/login with it and I'm having a little bit of trouble understanding all the tutorials around the web.
My question is simple, does the facebook php client lib work in my use case or only to develop facebook applications that run inside fb ?
I've recently upgraded MySQL on my Debian 5.0.4 server to 5.1. Now phpMyAdmin shows the following warning:
Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.43
Is it likely to cause any problems?