I'm just trying to figure out the regex to find any ampersands that aren't immediately preceded and followed by a space. For example, it would find "asdf&asdf" and "asdf& asdf" but not "asdf & asdf"
This will be used in a preg_replace to add spaces before and after. (If you're wondering, the problem is that I'm stuck with a WYSIWYG that...
Hello ,
Is it possible to delete rows in excel sheet using PHP ?
Can anyone guide me.
Regards,
Mithun
...
Hi all, I use emacs php-mode.el and php-electric.el. I want to get rid of the duplicate <?php overlay that shows up at the top of any php file.
The extra <?php is not actually in the file, but is a semi transparent visual overlay that emacs is adding. I've done some research, and I think changing this might involve the emacs lisp heade...
I want to display to a user a large text file (100MB Log Files specifically) via a web interface without requiring the user to have to download the entire file. Obviously returning the entire file to someones web browser would not be sensible, so my theory was to used Ajax to fetch portions of the file depending on the user scrolling th...
I am trying to do something similar to hangman where when you guess a letter, it replaces an underscore with what the letter is. I have come up with a way, but it seems very inefficient and I am wondering if there is a better way. Here is what I have -
<?
$word = 'ball';
$lettersGuessed = array('b','a');
echo str_replace( $lettersGues...
I am building a social network site in PHP/MySQL/jQuery. Once a user is logged into my site, I would like to query the DB and get an admin announcement if one exist. This will be a message box that shows on the page to all users but it will have an X to click on it and not show it ever again until the admin post a new announcement mess...
Hey all,
I am a bit stuck with this. I have to interface with an api that uses a version of an encryption algorithm that they seem to have ripped from Typo3 written by Ari Kuorikoski.
I need to create a ruby lib to interface with their api, so have to port their algorithm into ruby, and I am a bit out of my depth when it comes to encry...
On a social network I am working on in PHP/MySQL, I have a friends page, it will show all friends a user has, like most networks do. I have a friend table in mysql, it only has a few fields. auto_ID, from_user_ID, to_friend_ID, date
I would like to make the friends page have a few different options for sorting the results,
1) By auto...
I'm trying to count how many times an article has been rated by my members buy using PHP to count a certain articles total entered ratings that have been stored in my MySQL database.
I really want to use PHP and not MySQL to do this and was wondering how I can do this?
I hope I explained this right?
An example would be very helpful m...
I'm attempting to create a custom form field in Zend_Form to store a snippet of HTML that is required by SWFUpload(for the purposes of a flash file uploader).
I've tried following a few different tutorials but i'm getting pretty confused, so far this is what i have:
/application/forms/elements/SwfUpload.php
...
This is the million dollar question, I see it time and time again on here and other php coding related sites and forums but I have NEVER seen an answer to it.
So I started digging in and studying how some of the big high traffic forums accomplish this feature of showing you which threads have new unread posts in them and it appears th...
PHP and GD seem to have trouble creating images from PNGs of type greyscale with alpha when using imagecreatefrompng(). The results are incredibly distorted.
I was wondering if anyone knew of a way to test for the colour type in order to notify the user of the incompatibility?
Example:
Original Image: http://dl.dropbox.com/u/246391/R...
I'm trying to upgrade my doctrine ORM from 1.1.6 to 1.2.1 but i've enountered a BC issue with table names.
Some of my table names have several words (e.g. t_foo_bar for class FooBar) where the t_ prefix is generated automatically with:
$manager->setAttribute(Doctrine_Core::ATTR_TBLNAME_FORMAT, 't_%s');
This worked well in previous ve...
I am working on a website that has users and user-generated articles, galleries and video's. I am trying to make a tagging system and a search for them all.
At first I was thinking in tbl_articles, tbl_galleries and tbl_videos I would have a title, description and a tags field. Then run a query like the following for each:
select * fro...
Currently, I'm opening a database connection in my app's initialization. It's a fairly small app, PHP if that's relevant.
Should I be connecting to the database, making calls, then closing and repeating this process for each database function I write?
For example, I have the following function which grabs the $db variable from my app's...
<?php
$pageurl = "http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
$pageurl_noslashes = str_replace("/","",$pageurl);
$lang = substr($pageurl_noslashes,-3);
echo $lang;
?>
{exp:channel:entries channel="products" limit="10"}
<p>Product title: <span>{if title<?php echo $lang; ?>} {title<?php echo $lang; ?>} {if:else} {title} {/if}...
Hello,
My search query is something like this
SELECT files.id,files.file,files.name,files.uid,files.size,files.downloads,files.deleted,files.descr,
files.upload_id,files.thumb,files.category,files.expirydate,
MATCH(name,descr) AGAINST ('$all $none $any' In BOOLEAN MODE) AS score, users.`user`
FROM files Inner Join users O...
I have a php data migration script that serializes an array of text. Somehow, and this is not in my codebase, but the script is inserting \\\\\\\r\\\\\\\n into the string. Here is an example of what the output is like:
Product Line: [56313] LEGO Batman Screenshot\\\\\\\\r\\\\\\\\n[5
6384] LEGO Batman Screenshot[56446] LEGO Batman Screen...
I was hoping someone, could give some information on Cookies and Codeigniter, I have read there user guide on them so I have an understanding of how to set them, etc. What I want to know is how do I use for example if you look at the BBC website, you can drag and drop the boxes and it will remember where you placed them with out the need...
Hi ,
Just a quick question I know how I would build a cms using a database but why would you want to create a cms with xml ?
What are the pros and con's using xml also if I was to build a cms with xml would I need the help of a database of does xml just remove the need of a database ?
...