I've got a file that I'm writing to and I cannot get file_put_contents to append the next entry on a new line, even after a newline character. What am I missing? I'm on a windows machine.
$file = 'test.txt';
$message = "test\n\n";
file_put_contents($file, $message, FILE_APPEND);
...
I would like to run a Zend Framework action to generate some files, from command line. Is this possible and how much change would I need to make to my existing Web project that is using ZF?
Thanks!
...
How can I run this from PHP?
sudo /etc/init.d/apache2 restart
...
Hi, I have a problem with the pagination in my search page.
When a user search something I have a url like domain.com/search/?s=keyword
but paginator gives me links like domain.com/search/page:x,
so in the next and prev and numbers page the get parameter ist lost. I need to configure paginator to get links like domain.com/search/page:x/?...
It seems there is very few comparison between Selenium / WatiN and SimpleTest (which has web testing features too).
I tried Selenium and found the GUI great to create tests as you can see what's going on and record without typing all commands manually.
As for running the tests, Selenium is way more complex than SimpleTest. For SimpleTe...
Hi,
I'm looking for a good library / API to draw a binary tree using PHP.
I've tried using Image_GraphViz, but it doesn't seem to work. I've also looked at phpsyntaxtree, but its not documented.
Alternatively, I'm also looking for a jQuery plugin that does this. (just not this one because it has no documentation).
Thanks
...
In PHP, how to retrieve the files contained into a folder sorted by creation date (or any other sorting mechanism)?
According to the doc, the readdir() function:
The filenames are returned in the
order in which they are stored by the
filesystem.
...
Hi all,
I am trying to create a multi threaded PHP application right now. I have read lots of paper that explains how to create multi threading. All of those examples are built on diving the processes on different worker PHP files. Actualy that is also what I am trying to do but there is a problem :)
There are too many jobs even to ...
Hello, my first time here.
I got these lines as a response from the server and saved them in a file. They look like XML, right? My task is to read the content of those td tags and put them into other structured file(Excel). The problem is I dont know how to do that.
At the moment, I think I will strip the first and last line of the fi...
I have a variable called root. The value for this variable is 0
$root = 0;
if($root == "readmore"){
$root = 1701;
}
somehow for some weird reason if $root is 0 it still enteres the if statement above? I have no idea what it could be
...
I have these codes, used to update mysql database
...
$result = mysql_query("SELECT blog_title,body FROM blog WHERE post_id='$id' LIMIT 1") or die (mysql_error());
while ($line = mysql_fetch_assoc($result)){
$tasks[] = $line;
$group = $tasks['blog_title'];
$smarty->assign('view', $tasks);
$smarty->assign('group', $group);
//here the error.i want to assign blog_title to title
$smarty->...
I've some records in a DB where one of the VARCHAR fields may contain accented letters. If I do the following query using the CLI MySQL client I get 1 row returned, which is correct:
SELECT site_id, site_name FROM tbl_site WHERE site_name LIKE '%ém%'
However, using some PHP (PDO) to do the same query returns all the rows that contain ...
Hi
How could I improve the following organizational structure of my internationalization code? This is just a PoC, I'm using the php intl extension for translation in Intl::t():
index.php
1 <?php
2 //FILE translate.php, your "index.php"
3 $messages = include 'messages.php';
4 require_once 'intl.php';
5 Intl::setSource($messa...
ini_set('unserialize_callback_func', 'spl_autoload_call');
spl_autoload_register(array(self::getInstance(), 'autoload'));
Why set spl_autoload_call like above?
I made a test:
$serialized_object='O:1:"a":1:{s:5:"value";s:3:"100";}';
ini_set('unserialize_callback_func','mycallback');
function mycallback($classname) {
echo 1;
}
...
How do I get to get the values of checkboxes from mysql database, for example if stat6 is
dependent, then when I try to fetch the corresponding record using a primary key. Then if the stat6 is checked when I first added the record. It must also be checked when I update. But its not the case. How do I fix this?
<td></td>
<input type='hid...
In one form, I ask a user for his name, I use POST and send the user to FormTwo.php and save the $_POST["name"] to the session.
In the second for I ask for his lastname and do the same and send him to the registerComplete.php page.
I'm trying to echo all the information he wrote, which by my understand should be accesible through the $...
I'm getting $row['message'] from my mysql db and I need to remove all whitespaces like \n \t and so on.
$row['message'] = 'This is a Text \n and so on \t Text text.';
should be formated to:
$row['message'] = 'This is a Text and so on Text text.';
I tried
$ro = preg_replace('/\s\s+/', ' ',$row['message']);
echo $ro;
but ...
I'm creating a member dashboard where customers of my wordpress theme system can access updates and deploy them to multiple sites at once.
I need to choose a membership software that will allow me to manage user access and present both a common area where updates can be obtained, as well as a unique, user-specific dashboard interface wh...
Hello all,
I'm a bit lost, one of my developer co-worker is doing a drupal website, that is doing special pages, custom logos, custom hierarchy etc. His work is scattered in database tables (it looks like CCK create tables), database rows (texts, image links etc.), static files (pictures, PDFs ...) and maybe some PHP (custom module).
M...