Ok so my admin sets to edit a book which was created. I know how to bring in the values that were initially entered via a simple text field like 'bookname'. On the edit book page the book name field stores the currently assigned 'bookname' in the field (which is what I want! :) )
However I have other field types like selects and radio b...
Salesforce can send up to 100 requests inside 1 SOAP message. While sending this type of Bulk Ooutbound message request my PHP script finishes executing but SF fails to accept the ACK used to clear the message queue on the Salesforce side of things. Looking at the Outbound message log (monitoring) I see all the messages in a pending stat...
Hallo, how can I pass more parameters to usort?
I have different functions, which are very similar in structure, I want to have just one function:
<?php
$arr = array( array('number' => 100, 'string'=>'aaa'),
array('number'=>50, 'string'=>'bdef'),
array('number'=>150, 'string'=>'cbba')
...
uniqid() function returns a 13 digits long hexadecimal number. According to the spec in php.net site, the function uses microtime to generate the unique value.
But microtime returns numbers in string format as the following one:
"0.70352700 12689396875"
which are basically the microseconds and the seconds elapsed since 1970.
This is a...
Hi,
I have ten values in the dataset, numbers 1 - 10 and corresponding values. Some of the values are coming back as zero, so they are not added to the chart, BUT, the legend is still listing 1 - 10. Because there is values missing in the chart, the colour coding is knocked off. ie
Item 1, has a value of zero, its passed over in the ch...
I am trying to cleanup a string coming from a search box on a multi-language site.
Normally I would use a regex like:
$allowed = "-+?!,.;:\w\s";
$txt_search = preg_replace("/[^" . $allowed . "]?(.*?)[^" . $allowed . "]?/iu", "$1", $_GET['txt_search']);
and that works fine for English texts.
However, now I need to do the same when th...
echo date("W",strtotime('2010-01-01'));
This outputs 53. I would expect it to output 1. Can anyone else confirm this behavior, or maybe explain why? I couldn't find a bug report on it.
...
How to write byte by byte to socket in PHP?
For example how can I do something like:
socket_write($socket,$msg.14.56.255.11.7.89.152,strlen($msg)+7);
The pseudo code concatenated digits are actually bytes in dec. Hope you understand me.
...
I just signed up for BlueHost and one of their PHP config options is PHP5 (FastCGI).
I'm going to start using Codeignitor for as must as I can and was wondering if I should enable FastCGI or now.
Sorry if this is in the wrong place (vs serverfault.com)
...
Update:
This question is a duplicate of http://stackoverflow.com/questions/375542/
The answers given here appear to be disjoint from those given at the other node, so this question was not (yet) deleted. If possible, please merge the answers here into the other node.
Question:
Is there any such thing as a programming language (other ...
I've created a code to view the data. the data can't display at the form...
the code :
<?php //======================================================================================================================= PROCESS DATA ======================================================= START.
include "connectioncomplaint.php";
?>
<?php
...
I have a PHP function that requires can take 3 parameteres... I want to pass it a value for the 1st and 3rd parameters but I want the 2nd one to default...
How can I specify which ones I am passing, otherwise its interpreted as me passing values for the 1st and 2nd slots.
Thanks.
...
Hi guys,
I am required to write a report contrasting PHP5 and ASP.NET after building an application in both languages. I've been looking for papers and resources to reference and quote on the subject but i am running a little short.
I was wondering if anyone directions as where i could find such papers / resources.
Thanks in advance...
I have a custom loop that excludes categories using this code:
query_posts(array('category__not_in' => array(2,6)));
Instead of specifying the categories to exclude in the code, I'd like to be able to set the option in my custom theme options menu. The code to call the option is get_option('ex_cats');. How do I call this in my query_...
I have a template system, that replaces text such as {HEADER} with the appropriate content. I use an array like this, that replaces the key with the value using str_replace.
$array = array("HEADER","This is the header");
foreach($array as $var => $content) {
$template = str_replace("{" . strtoupper($var). "}", $content,$templ...
Is there any way I can avoid using array_flip to optimize performance. I am doing a select statement from database, preparing the query and executing it and storing data as an associative array in $resultCollection and than I have array op and for each element in $resultCollection am storing its outputId in op[] as evident from the code....
I'm wondering if I can use a static variable for optimization:
public function Bar() {
static $i = moderatelyExpensiveFunctionCall();
if ($i) {
return something();
} else {
return somethingElse();
}
}
I know that once $i is initialized, it won't be changed by by that line of code on successive calls to ...
I am trying to display a "preview" of an HTML email. I have the HTML in my database and now I need to render it in an iframe, or popup window or something. I am trying to inject the html into a div tag on the page, but it won't display anything. Here is the problem I am running into (I have nested HTML tags):
<html>
<body>
<...
So, imagine a mysql table with a few simple columns, an auto increment, and a hash (varchar, UNIQUE).
Is it possible to give mysql a query that will add a column, and generate a unique hash without multiple queries?
Currently, the only way I can think of to achieve this is with a while, which I worry would become more and more processo...
I'm using a customly created MySQL input sanitization library in one of my controllers, which makes a mess, using it in the model would be much easier, but I don't wan't to defy any best-practice principles out there either. So is it a good idea?
...