I would like to know how to get the values into this array. Can someone please help?
Each box whether it is the in or outbox should only be listed once and then have multiple ids associated with them. I need to be able to tell which id came from what box. The ids that are in the array are only samples.
$arr =
array(
'Inbox'=> a...
Hey all, I have a huge array coming back as search results and I want to do the following:
Walk through the array and for each record with the same "spubid" add the following keys/vals: "sfirst, smi, slast" to the parent array member in this case, $a[0]. So the result would be leave $a[0] in tact but add to it, the values from sfirst, ...
Hello,
I'm trying to write a simple function to close missing HTML tags using PHP preg_replace.
I thought it would be relatively straight-forward, but for some reason it hasn't been.
What I'm basically trying to do is close a missing tag in the following row:
<tr>
<th class="ProfileIndent0">
<p>Global pharmaceuticals</p>
<td>197...
I am getting the the output in Flex from PHP as...
appSes = new ArrayCollection (ArrayUtil.toArray(event.result));
I need the value to be stored in textInput...
<mx:TextInput id="keyword" styleName="glass" width="100%"/>
How to ??
...
Hi, guys!
Need your help with sql query and php.
I have to pieces of code here:
1.
$sql = "SELECT SUBSTR(n.`title`, 1,1) FROM node n WHERE n.`type` = 'type1'";
$results = db_query($sql);
while ($fields = db_fetch_array($results)) {
foreach($fields as $key => $value) {
echo $value;
}
}
The code above returns first letters o...
Can someone explain the difference between using
define('SOMETHING', true);
and
$SOMETHING = true;
And maybe the benefits between one or the other?
I use variables everywhere and even in a config type file that is included to everypage I still use variables as I don't see why to use the define method.
...
I've got a bunch of data which could be mixed characters, special characters, and 'accent' characters, etc.
I've been using php inconv with translit, but noticed today that a bullet point gets converted to 'bull'. I don't know what other characters like this don't get converted or deleted.
$, *, %, etc do get removed.
Basically what...
Is there any php/java/open source software converters or php libraries that will convert an xls file to a pdf document?
Rundown: Have pre-existing code generating xls spreadsheets (circa 2002-2006, pre open xml version I believe), need to turn them into pdfs for various reasons.
Been searching everywhere including here. I think I just ...
Hi,
I know that this question has maybe been asked several times but I have search several days without getting any satisfying answer.
Some sites, like eventful.com, etc. have a autosuggest city field with cities from around the world (even small cities in small countries from Tunisia).
I'm wondering how they achieve it. I've a text l...
I've got files with spaces in their names that are already on my server. I want to rename them with underscores. I've tried putting a slash before the space, and I've tried replacing the space with %20. Still PHP gives me: No such file or directory. Here's my code:
$dir = './';
$dhandle = opendir($dir);
$old_files = array();
if ($dhand...
Is threr a de-facto standard library for creating ASCII "tables" in PHP?
Basically, I want some PHP code that, when handed an Array or other data structure will output tables that look something like the mysql command line client's results
+--------+---------------------+----------------------------------+
| fld_id | fld_name ...
I have tried switching from a previous Post request to a Get request. Which assumes its a Get but eventually does a post.
I tried the following in PHP :
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, null);
curl_setopt($curl_handle, CURLOPT_POST, FALSE);
curl_setopt($curl_handle, CURLOPT_HTTPGET, TRUE);
What am I missing?
Additional ...
I have recently been looking at the Repository Pattern as a way of brushing all the details of persistence under the carpet where the client code is concerned. While reading around it appears that a Repository is/can be [usually?] responsible for aggregates rather than just straight-forward classes.
This make sense to me as you could h...
Hi all,
I have a string:
$string = "12,15,22";
Each of these values represents a usrID and I'd like to use these to select the rows associated with the $string.
Something like this:
SELECT usrFirst, usrLast FROM tblusers WHERE usrID = 12 OR 15 OR 22.
Now, the $string changes all the time, and sometimes can be a different number...
I'm currently using str_replace to remove a usrID and the 'comma' immediately after it:
For example:
$usrID = 23;
$string = "22,23,24,25";
$receivers = str_replace($usrID.",", '', $string); //Would output: "22,24,25"
However, I've noticed that if:
$usrID = 25; //or the Last Number in the $string
It does not work, because there is...
Hi Guys,
I have been using the PHP mcrypt module for encrypting sensitive data at my company. This has been working well. However, I have been requested to create a new master password which should be able to decrypt any data. The problem is that this master password would have to be hardcoded in a script file. Please correct me if I am...
How to become a freelancer?
Where can I get projects?
Tell me a best site for freelancer please.
...
This question is specific to using PHPUnit.
PHPUnit automatically converts php errors to exceptions. Is there a way to test the return value of a method that happens to trigger a php error (either built-in errors or user generated errors via *trigger_error*)?
Example of code to test:
function load_file ($file)
{
if (! file_exists(...
Hi all,
I have a string:
$string = "R 124 This is my message";
At times, the string may change, such as:
$string = "R 1345255 This is another message";
Using PHP, what's the best way to remove the first two "words" (e.g., the initial "R" and then the subsequent numbers)?
Thanks for the help!
...
Got it from php.net, but I am not sure is this how everybody destroy all sessions??
// Unset all Sessions
$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time() -42000, '/');
}
session_destroy();
Does the code will destroy all the sessions?? Is it the most common way? how do you guys...