Hello all,
I have confused myself to a point where I need to double check this with you all. Sorry if this is really a dumb question..
Okay - I have a PHP web application running on Linux that needs to support timezones. I provide a calendar widget that allows the user to set their timezone then select the date and hours/minutes for so...
Long time lurker, first time poster...
I'm now at the point where I'd almost call myself a professional grade PHP programmer and have a lot of code I re-use in various projects. Also, a lot of Open Source packages I've worked with use the MVC model and as a result I've done a lot of research recently into how it all works so I can bette...
Hi, everyone.
About a year ago I wrote a jQuery-inspired library which allowed you to manipulate the DOM using PHP's XPath and DOMDocument. I recently wanted to clean it up and post it as an open source project. I've been spending the past few days making improvements and implementing some more of PHP's native OO features.
Anyhow, I th...
Hello stack overflow I need help with this problem.
Ok, I have a flat file database in php it records users , hobbies, fav movies and all.
Now i want to add a buddy system so they can have friends and send messages to each other in php without SQL.
...
Hi,
the function of ceil() in php is not useful in my case, because i want if the number contains from 0.50 to 0.99 then it's will ceil it, if it's smaller than 0.50 it's will not do anything.
example:
6523.70 will be 6524
but
6523.49 will stay same.
i hope you got it guys :)
Thanks
...
Hello,
I want to do something if my sentence include one of the words in this array, How to do that ?
$sentence = "I dont give a badwordtwo";
$values = array("badwordone","badwordtwo","badwordthree","badwordfour");
Thanks...
...
In many reviews, there's usually a feature to sort by date, helpfulness, etc... Essentially these work by querying a new MySQL line right?
For example:
$sql = "SELECT * FROM TABLE ORDER BY TimeAdded"
$sql = "SELECT * FROM TABLE ORDER BY Helpfulness"
Or would there be a better way to do it?
Secondly, making pages for reviews. Is it a...
Hello folks.
I'm trying to give one of my roles the administrative rights to add/remove content in a specific menu (but not all menus). I think I found a module that should enable something like this, http://drupalmodules.com/module/delegate-menu-administration
I've followed the instructions, added the role to my user, checked the "adm...
What will the code below be if value is 2 and counter is 11? What would $rating be?
$rating = (@round($rs[value] / $rs[counter],1)) * 10;
The complete code is below.
function getRating(){
$sql= "select * from vote";
$result=@mysql_query($sql);
$rs=@mysql_fetch_array($result);
$rating = (@round($rs[value] / $rs[counte...
I have a php script which needs to connect to a database. The credentials for the database are stored in another php script.
If I set the permissions for the credentials file to 661 so that Public has execute permission but not read permission, does this allow the main script to access the credentials and connect to the DB while prevent...
Can I use Lucene with PHP ? I don't want to use Zend. Can I use in native PHP (not framework) ?
...
define('test',2);
if(isset(test))echo 'hi';
...
How to group symbols for "not in range" expression in PHP?
<li class="first">list item 1</li>
<li class="second">list item 2</li>
<li class="third">list item 3</li>
<li class="fourth">list item 4</li>
...
I'd like to cath all li elements except one with class="second"
This does not work:
/(<li[^(class="second")]+</li>)/xsU
...
I'm currently migrating from a class that stores lists of countries, states & provinces in the form of arrays to using Zend's Locale data in the form of ldml xml files. These ldml files provide localised lists of countries, currencies, languages - so I'm not exactly sure where I should store US States, ( Canadian Provinces ), Prefixes - ...
Hey,
So I am new to symfony and am trying to make a is-a relationship between several tables. I have a media table that has a id field that is the primary key. I then except to have 2 or more additional tables that are "subclasses" of this table such as an article or event table. These are subclasses of the media table and I put a media...
I want to control the display of images with the PHP GD library -- I am going to add some text to the bottom corner of it on the fly when a browser requests the image, rather than saving the text into the image.
I know that I can do this: set the MIME type in the header and then call imagepng(...) with the filename to just display the i...
We have a setup a product management system where the head of the product development can upload pictures of products and those pictures will instantly show up on our website.
Last week, when one person left the job, he uploaded a bunch of XXX-Rated pictures and things showed up immediately on the website. Luckily, we noticed and remove...
Hi, I have some articles stored in a text field in my database. There are times when the article includes <textarea>content.....</textarea>
The problem is that when the content is displayed on a page using php, it includes the actual <br><br><br>. The <br> is placed there by the text editor (CKEditor)
So it looks like the following
<...
I've a generic DB query function that runs the following checks every time an SQL query is issued:
if (preg_match('~^(?:UPDATE|DELETE)~i', $query) === 1)
if (preg_match('~^(?:UPDATE|DELETE)~iS', $query) === 1)
if ((stripos($query, 'UPDATE') === 0) || (stripos($query, 'DELETE') === 0))
I know that a simple strpos() call is way faster ...
I'm building a unit testing framework for PHP and I was curious if there is a way to get a list of an objects methods which excludes the parent class's methods. So given this:
class Foo
{
public function doSomethingFooey()
{
echo 'HELLO THERE!';
}
}
class Bar extends Foo
{
public function goToTheBar()
{
...