Apache lets you set php.ini values for virtual hosts with the php_value directive.
Does nginx have something similar? Is there another way to set the include_path on a per-site basis?
I have some strings which contain the words LIMIT 3, 199 or LIMIT 0, 100.
Basically I want to replace the word LIMIT and everything after it in my string.
How do I do this in PHP? str_replace only replaces an item and the LIMIT text after is dynamic/
So it could be
WHEN JOHN WAS TRYING HIS SQL QUERY, HE FOUND THAT LIMIT, 121
// RETURN WOULD BE
WHEN JOHN WAS TRYING HIS SQL QUERY, HE FOUND THAT
WHEN JOHN TRIED LIMIT 343, 333 HE FOUND
// RETURN WOULD BE
WHEN JOHN TRIED
I want to make a little php poll. The script should ask the users a question they can only answer by numbers from 0-999. After pressing the submit button the data should be stored into mysql. So I just want to know how much users choosed the same number (in percent). It's a simple poll but I don't want any output to be shown.
Hi, I'm just wondering how I could remove everything after a certain substring in PHP
ex:
Posted On April 6th By Some Dude
I'd like to have it so that it removes all the text including, and after, the sub string "By"
Thanks
Hello.
I have an array with integers of values from 0 to 100. I wish to remove integers that are less than number X and keep the ones that are equal or greater than number X.
I am using PHP.
Thanks!
Hey guys,
How do I go about setting a string as a literal variable in PHP? Basically I have an array like
$data['setting'] = "thevalue";
and I want to convert that 'setting' to $setting so that $setting becomes "thevalue".
Thanks for any help!
Hi, I wanted to ask:
when I am using php.net/bzopen, does I need to bzwrite() already compressed by bzcompress() string or it being compressed automatically while writing?
As far as file permissions are concerned, when you use a php script to unzip a tar file, who is the "owner" user of the files created?
I'm wondering if its my ftp user because I uploaded the script file? Or does apache own the file? I know their are flags to be set to preserve the original permissions which I don't want (files where created and archived by someone else). I want my user to be the creater/owner of the files.
Hi ALL~
I'm getting this error while I was implementing and testing PHP webservice using Zend Soap.
I'm testing the same codes under 2 different protocols(http & https) in 2 different web servers.
http site works just fine, but I get "SoapFault exception: [VersionMismatch]..." error in https.
The two web servers almost have the same specs.
Is there anyone who can help me with this?
Hi,
Is it possible to have Javascript compute a timestamp returned from php's time() function and present it in a readable format such as "Sun, 18th April 2010 at 4:00 pm"?
Thanks:)
I have a Php script I want to use for creating a new blog in WPMU. I am having trouble calling wordpress functions like "wpmu_create_user" and "wpmu_create_blog".
My hope is to get this script running as a cron job from command line and pick up new blog creation requests from an external db, create a new blog using the wordpress functions and update the db with new blog info.
Any help/suggestions are highly appreciated.
Sid.
I have a php script that execute a bash script. I try to pass parameters like this:
$script="/opt/lampp/htdocs/adapt.sh"
$file="/opt/lampp/htdocs/videos/video1.mp4"
$prefix="Test"
exec ('.$script.' '.$file.' '.$prefix.');
What's wrong? How can I pass the parameters?
Can anybody point me towards a PHP library or script that would allow me to split a pdf consisting of multiple pages into separate files, each containing 1 page. The PDFLib documentation doesn't appear to allow this and Google hasn't been particularly helpful.
I could possibly also use Perl, but it would be very inconvenient to do so.
Hi,
I want to get time zone through IP Address in PHP. Actually i have an application which will run at the client machine. I have IP address of client machine. But not able to get the time zone for each client machine.
Please reply me.
Thanks
Devesh M
Hi, I'm looking for a grid control for a project I'm doing in PHP.
Are there any good recommendations?
Ideally, it'd have a data entry mode similar to a spreadsheet where the user could enter row after row after row, without needing to click new/edit buttons or links.
Hi,
I'm sending email with PHP's mail function.
It works just as it should except all email clients show blank From-field.
Here's how i'm using the function:
mail( '[email protected]', "Example subject", $msg,
implode( "\r\n", array( Content-Type: text/html; charset=UTF-8', 'From: [email protected]') ) );
As i said everything works fine except From field is all blank when the message arrives.
Any ideas why this is happening?
I want to write a PHP script to output some data as a plain-text table using spaces to get the data into columns (just like the Linux top command). I can't use a HTML table as the script output will be saved to disk and viewed in a plain-text editor.
Is there anything available that can do this automatically (format the data into columns)?
I am trying to use an update query to change values held in a database, the new values I am trying to store are held in php variables. I'm not sure what it is I'm doing wrong.
mysql_query("UPDATE user SET
status='full' WHERE user_id =
'$user_id'")or die(mysql_error());
thanks in advance
Trying to output the following 5 but not sure how to do it. Any ideas?
<?php
$other='What are you like?';
$content['my_name']=4;
$str=<<<JT
here is some info. $other Do
you like the number {$content['my_name']+1} ?
JT;
echo $str . '<br />';
I am looking for the best br2nl function. I would like to replace all instances of <br> and <br /> with newlines \n. Much like the nl2br function but the opposite.
I know there are several solutions in the PHP manual comments but I'm looking for feedback from the SO community on possible solutions.
Can anyone explain if it is possible to have a web server for all of these technologies:
ColdFusion, PHP, MS SQL Server, MySQL
I have a web developer insisting that they require all of the above however it doesn't quite make sense to me.
Any help or clarification is appreciated.