I am trying to match <a> tags within my content and replace then with the link text followed by the url in square brackets for a print-version. The following example works if there is only the "href". If the <a> contains another attribute, it matches too much and doesn't return the desired result. How can I match the URL and the link ...
Hello,
I'm trying to use FlashMessenger to notify another user of an event. Does anyone know if this is possible?
Something like
$flashMessenger->addMessage( array('status'=> '', 'message'=> 'Hello!'), $user);
...
Hiya,
I'm trying to parse an XML file and one of the fields looks like the following:
<link>http://foo.com/this-platform/scripts/click.php?var_a=a&var_b=b&varc=http%3A%2F%2Fwww.foo.com%2Fthis-section-here%2Fperf%2F229408%3Fvalue%3D0222%26some_variable%3Dmeee</link>
This seems to break the parser. i think it might be so...
Hello, I am trying to do a dual-timetable system thing.
Basically, it's for a school project, and some schools have week 1 and week 2 systems.
The way this works is through alternating each week, so at the start of september, the school week starts on week 1, and the next week is week 2.
How would I implement this in PHP an MySQL?
...
I need to process credit cards and integrate with backend payment services to credit them. The majority of solutions on the internet require an intermediary, eg. 2CO, GCO, Auth.net.
Do you have any experience with implementing a credit-card payment gateway in PHP? Any help in appreciated.
Thanks for your time.
...
Is there anyway to sort a column by name, and ignore the quotes that being some items?
For example:
"This is cool"
Another article
Article 2
Hello
Would sort as:
Another article
Article 2
Hello
"This is cool"
The quotes are already in the database...
...
Is it possible?
Normally, it requires two lines:
$instance = new MyClass();
$variable = $instance->method();
Is something like this possible in PHP?:
$variable = new MyClass()->method();
Of course, the first code is better for readability and clean code, etc., but I was just curious if you can shrink it. Maybe it could be useful, ...
How do people generally handle conditional statements in MVC frameworks
For some of my pages (made under Kohana) I want the user to have more options depending on whether they are logged in or not, and whether the profile is their own profile for example. From your own experience, do you create separate views, empty variables, do the l...
I have a feeling the answer is "it's not possible," but thought I'd ask to satisfy my curiosity.
I have some code that's echoed where the \n is unavoidable:
echo "Hello \n";
echo "World!";
I'd like the line to simply read (in the code output):
Hello World!
... thus removing the \n.
So I was wondering if it's possible to execut...
I am trying to write a PHP program to automatically created backups of MySQL tables as sql files on the server:
$backup = "$path/$tablename.sql";
$table = "mydbname.mytablename";
exec(
sprintf(
'/usr/bin/mysqldump --host=%s --user=%s --password=%s %s --quick --lock-tables --add-drop-table > %s',
$host,
$user,
$passw...
I was wondering what is the best way to write the where statement in PHP where targetDate < Date.Now - HardCodedHours in PHP
...
I'm writing a little bit of PHP, but Im a serious nOOb.
I want to compare the current time (The time now) with a timestamp in a table, stored like 1085225495.
If the timestamp is under 1 hour old, then do:
UPDATE TABLE SET visible=0;
Otherwise ignore.
Any ideas in php?
...
I am scraping some information from a 10 year old website that was built in ASP using Frontpage(originally) and Dreamweaver(lately). I am using PHP.
I am getting back strings with whitespace that is not spaces. Using the PHP trim function, some of the white space is removed but not all.
original string: string(47) " School Calendar"
...
I am trying to figure out what is the best way to
Grab the current date/time (is date('Y-m-d H:i:s') best?)
Grab the db date from SQL
Check if the current date (#1) is between the date pulled from the DB and 5hours after it
I'm a newbie at php.
...
Hy there,
Bulk insert question on how to get lastInsertId.
INSERT INTO details (idactivity,user,hours,val,date) VALUES ('981','133','0','10500','2008-07-01'),('981','184','0','2750','2008-07-01'),('981','184','0','2750','2008-07-01')
(iddetails as details table PK)
Is there a way to get the 3 new iddetails and get them to the next bu...
I'm working on a project with remote Flash developers, and they have requested that when my PHP application sets up the HTML to load their Flash object, I pass in a seed that they can use to generate random numbers with (the seed is stored so that a particular game can be replayed later).
If you were seeding PHP's RNG, you might use the...
I need a simple way for multiple running PHP scripts to share data.
Should I create a MySQL DB with a RAM storage engine, and share data via that (can multiple scripts connect to the same DB simultaneously?)
Or would flat files with one piece of data per line be better?
...
I know this question would have run across in the minds a lot of people till now, but let me rephrase it according to my doubts.
Amongst some of the more popularly known CMS, what are some of the most distinctive features that make you use a particular one?
Factors that you can consider are
Flexibility (The degrees of websites that can...
I have in a video sharing website project these models :
class Video extends AppModel {
var $name = 'Video';
var $hasAndBelongsToMany = array(
'Tag' => array(
'className' => 'Tag',
'joinTable' => 'videos_tags',
'foreignKey' => 'video_id',
'associationForeignKey' => 'tag_i...
I'm looking for some software that will allow me to do the following:
I don't need anything fancy, just basic information, back and forth dated comments, etc. No payment integration, or file handling.
Thought I'd ask before I write my own
...