Can anyone help me decode why this doesnt work?
$cssid = preg_replace("/'/", "", $cssid);
Trying to strip the single quote marks from some html...
Thanks!
H
EDIT
This is the full function - it's designed to rebuild the Drupal menu using images, and it applies CSS classes to each item, allowing you to select the image you want. Str...
im doing parsing and the kind of text that i want to match and then make it null is as follows :-
<tr class="label-BGC"><td colspan="4">any kind of text here</td></tr>
i want to match every line that contains "<tr class="label-BGC"><td colspan="4">any text</td></tr>"
its evening here and my brain-battery is totally down
what im try...
Are there any ways to automatically trim an MP3 uploaded to a website to 30 seconds (or some other length) in PHP? If not, is there any good 3rd party services that could be integrated (transparently to the user) to achieve the same effect?
Thanks.
...
hi
i have old code which didnt use TDD
now i want to write a test for a function which looks like this
function somefunction($someargs){
// do a few checks on $someargs
$database = new DB_PG();
$result = $database->select($query);
// do some changes on result
return $result;
}
since im not much expirienced with ph...
Hey all!
I was wondering of a solid way to find phrases/words that are part of an HTML document. For example if I have the following document:
<a href="#">This is a test</a><b>Another test</b>
My goal is to find "This is a test" and "Another test" and replace it with something else. Note that these are sample phrases and it could con...
For this code i need to take a string like
<b>hey</b> more text<b>hey2</b> other text
and i expect the returned array to look like
<b>hey</b> more text
<b>hey2</b> other text
However it doesnt. How do i make it look like the above? my test code is
$myArr = split("<b>", "<b>hey</b> more text<b>hey2</b> other text");
foreach($myArr ...
I want to create an array using PHP that can be used in MySQL.
My query looks like this...
select
name,
sum(if (tdate='2009-09-09', amount, 0) as day1,
sum(if(tdate='2009-09-10', amount, 0) as day2
...
...
sum(if(tdate='2009-10-01', amount, 0) as day23
from revenue
group by name;
The date range may change but ...
I have some code that may be passed either an indexed array of values, or an associative array of value pairs. (The parameter is then used to construct radio buttons.) What's the most elegant (least resource hungry?) method for determining which I have?
EDIT: One slight problem with this: what if the array to be tested is as follows.......
Looking to read the file size of the SOAP POST, any best practices?
$data = fopen('php://input','rb');
$content = fread($data,5000);
$dom = new DOMDocument();
$dom->loadXML($content);
Would like the 5000 to be dynamic as each SOAP POST size will be different or does this matter?
Using fread() would be great
...
If I am sending data from my ajax request as type:delete
How do I then access it on my php page instead of $_GET or $_POST
?
...
Are there any reasons not to want to use a multi dimensional SESSION array to store temporary user data?
...
Hi guys,
I have basic idea about running PHP in different configurations like mod_php, cgi, FastCGI, etc.
In my findings and test I found FastCGI is slightly better. I like FastCGI's support for SuEXEC most. Wait I do not want to get into benchmarking business here again. If you surf web, you will find people proving one way is faster ...
Hi,
I have some trouble matching the contents inside php tags.
Currently I have this code, but it's not working for me:
<?php preg_match_all('/<\?php(.+)\?>/', $str, $inside_php); ?>
I need to retrieve the contents so I can do other things with them, like eval().
...
Good day!
I'm trying to run the same update statement with the same params twice and it seems that it is not executed in the second case:
$update_query = $this->db->connection->prepare('UPDATE `Table SET `field` = :price WHERE (`partnum` = :partnum)');
$update_query->execute(array('price' => 123, 'partnum' => test));
var_dump($update_...
Hiya,
I'm using Drupal 6, Image and NodeAsBlock, and I'm trying to link my nodes into pages. That all works, but each time I link an image I get by default:
Title
Thumbnail image size
No hooks to help me style it in css
Is there a way I can get around this? I really want to just upload an image, click the "create block" textbox and...
I am using PHP & GD library.
I want to draw an image (say this one: http://www.gravatar.com/avatar/107f2fafb2d29fedc3783b141139a878?s=128&d=identicon&r=PG) over another image: http://www.geekpedia.com/gallery/fullsize/simplistic-windows-wallpaper.jpg at specified coordinates (top-left or top-right or anywhere in the image).
How...
I'm trying to use CAS for SSO between Liferay and a PHP webapp.
I installed JASIG CAS webapp, created a certificate with keytools and configured Liferay through its administrative GUI (Setting>Authentication>CAS tab) as follows:
When I click on "Sign in" in Liferay menu I'm forwarded to the CAS login page (with the "dirty trick" user...
I need to know how to create a back link in the action view of the Yii Framework.
I want to use CHtml::link('Back',Yii::app()->request->urlReferrer); but this somehow just does not want to work?
Quite new to this Framework.
...
Hi
I need to send some arguments from the iPhone to a php in the server
PHP:
$text = $_GET['text']);
$mail = $_GET['mail']);
$phone = $_GET['phone']);
iPhone SDK
NSString *text = [[NSString alloc] initWithString:@""]; //very long text
NSString *mail = [[NSString alloc] initWithString:@"[email protected]"];
NSString *phone = [[NSString all...
okay on our testing server the language works fine whetter your click it twice or more but when transffered onto the clients server bugs occured... to see the bug click on "FR" top left (it's now on French) once click on "EN" (it stays in french click it again and it gives you a page with no style saying page not found) . I've been over ...