Going through a weird problem here.
I am trying to get the date of coming March, but it doesn't seem to work.
$nextMarch = strtotime("next march");
What could be wrong with this tiny little code?
This is a question related to this question:
http://stackoverflow.com/questions/1872812/timestamp-of-nearest-valid-month
...
Hi,
I am developing a face book like notification module in php/mysql where in the user is notified with the latest activities among his friends (Added Photo/Added Video/Commented etc....). What is the best approach to design this module in terms of database. Does it need to have a seperate table for each activity(say photos). Or a sing...
I am using
<a href="index.php" onclick="history.back();return false;">Back</a>
to provide a back to previous page link. It works fine on Windows (IE/Mozilla) but fails in Safari on both Windows/Mac.
Is there a way to make it work on all of the systems/browsers (cross-browser/platform)?
If it's not possible, is there any other way u...
Hello All,
PHP allows you to replace or even re-name PHP's built-in functions using functions such as
override_function and rename_function.
Can we override the PHP's language constructs like the ones below?
echo
eval
...etc
...
Hi folks! I'm writing trying to build a calendar right from scratch. I'm using the function written by David Walsh (see link) and it's great.
He does a query for each day's cell.
But, I'm afraid that when the script's gonna have to run 30 queries in each render, it's gonna be sloooow.
So, I was trying to think in another logic, for ex...
need a simple preg_replace to convert all <br> <br/> and all possible br combinations to <br />.
This needs to work in order so i can process a string ie:
$output = preg_replace('', '<br />', $input)
Thanks everyone!
...
Okay first let me just say that my script works fine it just shows these warning when nothing is in the database. What I want is to make the warnings go away even when nothing is in the database.
How can correct this problem? And what part of my code do I need to change?
Here is the warnings.
Warning: ksort() expects parameter 1 to b...
What is the easiest way to Html encode in PHP?
...
Is it possible to hide the .php file on the server...?
I have a website which sometimes calls php files inside iframes, now I wouldn't like it if somebody copied that code, so how would I hide it?
Or do I have to encrypt it?
Speed is a huge matter in my case, so anything that doesn't affect performance is appreciated!
Thanks
...
Hi, I'm developing a REST CodeIgniter Controller and need to POST and PUT to a URL in multiple formats.
The main formats I can think of would be:
XML
JSON
HTML Form data
There will be a response format defined in the URI e.g. /format/xml or /format/csv.
I don't want to have to define the request format in the URI as well.
I was w...
Hi,
I'm having a problem fetching the absolute URL of a remote image. What I'm doing right now is this:
foreach($html->find('img') as $e){
$path = parse_url($e->src, PHP_URL_PATH);
$absolute = realpath($path);
if($e->src==$path){
echo '<img class="pic" src=' . $absolute . '/><br/>';
}
}
This code has been written using t...
I'm trying to simulate this error with a sample php code but haven't been successful. Any help would be great.
"Cannot use string offset as an array"
...
I'm not sure if this is possible, but here's what I would like to do.
I have a .php script that uploads and then manipulates the file. I only want that particular .php script to be allowed to upload large files, the php.ini settings should apply for all others.
Can I edit the .htaccess file to affect only the one .php script?
In pseu...
Is there an elegant and easy/simple way to do it using PHP, Javascript or Jquery?
...
I'm developing a PHP application which will charge users for the videos they watch. The business model is "everyone pays for how much she watches". For this purpose, I need to;
Implement secure video (FLV) access. (Authorized sessions will gain access)
Calculate how much video (FLV) data is sent from the server.
A trivial solution for...
I was wondering should the following code listed below display when empty because it does not.
Is this the correct way not to display code when it's empty? If not how should my code look when I don't want the code to be displayed if it's empty? I hope that does not sound confusing?
Here is the code.
<?php
if(empty($link)){
echo '<d...
For example i need to retrieve a value from this session. How should i do ? Exactly i need to get the "customer_log_id".
> Array (
> [core] => Array
> (
> [_session_validator_data] => Array
> (
> [remote_addr] => 127.0.0.1
> [http_via] =>
> ...
I am creating a web application which requires threading and I am trying to figure out which langauge between PHP and Ruby has better threading functionality and better performance.
Even if not in built, some easy work arounds or add-ons.
...
I'm reading a textfile on the format
Phone#(tab)Text(line break)
(line break)
Or more specifically
4799999999 Hey! You owe us $576.53. Pay up to account no. 9760.00.12345, ID: 201561438.
4798888888 Hey! You owe us $199. Pay up to account no. 9760.05.12345, KID: 201565173.
4797777777 Hey! You owe us... and so on.
I want to store...
I want to allow users of my website to upload photos and video from their mobile phone. I have a web-based upload page (built using Flash) that posts uploads to a PHP script running on an Apache web server in Amazon EC2 cloud. I would like to use the same server to receive files uploaded by mobile.
The 3 options as I see it are - (coul...