php

disable memcache and apc

I'm working on a PHP script on a remote server-- apparently the caching is more than a bit too aggressive, since even after I change the code of the page, the result is the same when the page is called from a browser (I get an error about a command that I've totally commented out, and it's a simple page). Is there a way to disable memca...

Mysql - Summary Tables

Which method do you suggest and why? Creating a summary table and . . . 1) Updating the table as the action occurs in real time. 2) Running group by queries every 15 minutes to update the summary table. 3) Something else? The data must be near real time, it can't wait an hour, a day, etc. ...

Removing word + wildcard number from string

Hi, I have a string that is $str = "testingSUB1"; How can I strip out SUB* from the string? I assume using preg_replace but I'm not good with matching what I want with regex. Does anyone know how I can do this? Thank you ...

Add Checkbox column in flexigrid

The issue about jquery flexigrid using php. unfortunately http://flexigrid.info site is down very often so managed to take some sample code from http://sanderkorvemaker.nl/test/flexigrid/ and worked based on that. The above sample code works now I need to create a grid with a column with checkboxes, So that I can click a couple of tho...

SimpleXMLElement to PHP Array

Variable $d comes from file_get_contents function to a url. $answer = @new SimpleXMLElement($d); Below is output of the print_r($answer): SimpleXMLElement Object ( [Amount] => 2698 [Status] => OK [State] => FL [Country] => USA ) How can I retrieve value of each element and add to an array? can't figure it out. ...

Can you unregister a shutdown function?

Is it possible in PHP to unregister a function (or all functions) set up with register_shutdown_function()? ...

Call Python From PHP And Get Return Code

Hello everyone, I am calling a python script from PHP. The python program has to return some value according to the arguments passed to it. Here is a sample python program, which will give you a basic idea of what i am doing currently: #!/usr/bin/python import sys #get the arguments passed argList = sys.argv #Not enough arguments. ...

Update query with conditional?

I'm not sure if this possible. If not, let me know. I have a PDO mysql that updates 3 fields. $update = $mypdo->prepare("UPDATE tablename SET field1=:field1, field2=:field2, field3=:field3 WHE...

How to combine a Distance and Keyword SQL query?

Hi Folks, I have a tables in my database called "points" and "category". A user will input info into both a location input and a keyword input text box. Then I want to find points in my table where the keyword matches either the "title" field in the points table, or the "category" but are within a certain distance from the user's loca...

looking for PHP login script

Hey, I am looking for PHP login script that allows a user to sign in, confirm his email and save his login/password if he wants. Is there something free and simple to support and modify? Thank you. Michael ...

WP_Insert_Post and GUID Issue [Wordpress]

Hello, I have a posting form at my theme. I used wp_insert_post there. My code looks like this $post = array( 'ID' => '', 'post_author' => $post_author, 'post_category' => $post_category, 'post_content' => $post_content, 'post_title' => $post_title, 'post_status' => 'publish', ); $post_id ...

Updating Checked Checkboxes using CodeIgniter + MySQL

Hello I have about 8 check boxes that are being generated dynamically from my database. This is the code in my controller //Start Get Processes Query $this->db->select('*'); $this->db->from('projects_processes'); $this->db->where('process_enabled', '1'); $data['getprocesses'] = $this->db->get(); //End Get Processes...

php return elements from file content

Pretty simple i'm sure, but.. I've got a file that is guaranteed to have only an <h1>some text</h1> and a <p>some more text</p> in it. How would i go about returning these to elements as separate variables? ...

Problem with checkboxes, sql select statements & php

I am trying to display some rows from a database table based on choices submitted by the user. Here is my form code <form action="choice.php" method="POST" > <input type="checkbox" name="variable[]" value="Apple">Apple <input type="checkbox" name="variable[]" value="Banana">Banana <input type="checkbox" name="variable[]" value...

Elegant solution for line-breaks (PHP)

$var = "Hi there"."<br/>"."Welcome to my website"."<br/>;" echo $var; Is there an elegant way to handle line-breaks in PHP? I'm not sure about other languages, but C++ has eol so something thats more readable and elegant to use? Thanks ...

Explain this interview question to me...

Explain this interview question to me... Q: If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b? A: 100, it’s a reference to existing variable. ...

Removing character from php string variable

I have a variable in PHP like Logo™. How do I remove the character ™, if it's present? ...

How do you slow down the output from a DOS / windows command prompt

I have lots of experience of writing php scripts that are run in the context of a webserver and almost no experience of writing php scripts for CLI or GUI output. I have used the command line for linux but do not have much experience with DOS. Lets say I have php script that is: <?php echo('Hello world'); for ($idx = 0 ; $idx < 100 ;...

using php to create a joomla user password?

Hi all, I'm trying to create a custom registration component for Joomla, and I was wondering if anyone knew how to create the correct password encryption for joomla? Joomla passwords look like this : fbae378704687625a410223a61c66eb1:VM6DwmVWHTwpquDq51ZXjWWADCIc93MR Which I believe are md5 (or something) and one way encryption? Am just...

Searching documents by tag using the Scribd API is no longer returning expected results.

Recently I have encountered an issue with Scribd where searching via Scribd API (docs.search) for documents by tag is no longer working. This has been working (for over 6 months) to return a number of documents that I have tagged with "fdsafetyandprevention" (accessible here http://www.scribd.com/tag/fdsafetyandprevention). Just recentl...