I need some function to check is the given value is a url.
I have code:
<?php
$string = get_from_db();
list($name, $url) = explode(": ", $string);
if (is_url($url)) {
$link = array('name' => $name, 'link' => $url);
} else {
$text = $string;
}
// Make some things
?>
...
I'm wondering if this is possible: user uploads a picture which is then presented to him in the browser. The image is placed inside a div that has predefined image as background. User can drag and drop his uploaded image inside the boundaries of this div.
It would be something along the lines of uploading a pic of yourself and then pos...
hi
i have a problem with xdebug on a FreeBSD server. on that server xdebug profiler's cachegrind files say that executing time of native functions (such as DOMDocument::load() or XSLTStylesheet::importStylesheet) is about 50% of total script execution time. and with profiler turned off those functions work for less than 0.1%
on my own ...
Hi,
I'm trying to apply the german format of a date to a Magento email. I can get the invoice date with
{{var invoice.created_at}}
but that gives me "2010-05-21 15:46:24". I would like to have 21.05.2010 and PHP doesn't work in the templates.
I'm totally new to Magento so please be patient :-P
Greetz
Spanky
...
I'm trying to save 3 XML url links to write to local xml cache copy of them. But 2 of the XML url links with parameters passed after ? aren't saving at all ?
only allteams.xml gets saved into multicache folder while other 2 urls don't get saved ?
there must be a better way to do this ?
<?php
$urls=array(
'http://remotedomain.com/api/...
Hi, sorry, this is a really noob question...
When I want to print part of the $content array within node.tpl.php (for example), I'll use something like <?php print $node->content['body']['#value']; ?>
I just want to understand what the -> is all about. Presumably this indicates that $node is something other than a normal array? ( Othe...
I have the following XML data which is generated by a webservice
<?xml version="1.0" encoding="UTF-8"?>
<rsp xmlns="http://worldcat.org/xid/isbn/" stat="ok">
<isbn oclcnum="263710087 491996179 50279560 60857040 429386124 44597307" lccn="00131084" form="AA BC" year="2002" lang="eng" ed="1st American ed." title="Harry Potter and...
Hey all,
I'm trying to make a small CMS for fun but I'm getting caught up on some semantics with OOP. I have a basic database class and then I have an administrator class. The admin class has to make database queries, so what I've been doing is having the admin class extend the db class and then passing the link to the db resource via c...
I have the following foreach
foreach( $array as $v )
{
if( SOME LOGIC HERE ) $class = "first";
if( SOME LOGIC HERE ) $class2 = "third";
print '<span class="$class $class2">$v["name"]</span>';
}
I want to set $class1 to be 'third' for every 1st, 4th, 7th, 10th (3n - 2) and $class2 to be set to 'third' for 3rd, 6th, 9th...
Hi
I'm new in wordpress. I want to create a website to display my product stocks. An I want to use wordpress to maintain the content of the website.
I was wondering is there any way of using my own PHP scripts to access my 'product database' information within from WP and display them. Bascially, wordpress will use it's own database f...
I'm creating a login system in PHP, and I want to know how to best protect the user information string in my cookie. I was thinking of encrypting the string with a key somehow? Is this the best way? I'm kinda new to this.
Thanks in advance.
...
I's like to do a join between 2 tables on a specific ID. At the moment, I have this DQL:
$q = Doctrine_Query::create()
->select('e.*, i.itemName, i.itemtypeId')
->from('Model_EventItem e')
->leftJoin('Model_Item i ON e.itemId = i.itemId')
->where('e.eventitemId = ?', $event->eventId)
->orderB...
I have this nice big Dev Kit written in PHP, but the application I'm currently developing is in CFML.
In an attempt to avoid rewriting the PHP, I'm going to try to just wrap the PHP in CF <script> tags and call the PHP functions when I need them.
Does anyone have any idea how to call one of those PHP functions inline in CF?
...
I am developing an application for schools in South Africa which is required to submit data in XML format to the State IT Agency for statistical processing. I am currently generating the XML files using PHP's DOMDocument class.
My files have gone through a first stage verification process. The next stage is to implement encryption and c...
I was wondering if it is possible to post a file - along with other form data - when the file is just a string?
I know that you can post a file that is already on the filesystem by prefixing the filepath with "@".
However I'd like to bypass creating a temporary file and send just the file as a string, but I am unsure how to construct t...
Hi Guys,
I've got a variable in a php function of mine which is passed into a SQL query. I'm wondering how do I append " and " either side of it without actually turning it into a string?
Thanks.
...
I'm new to wordpress and currently developing a theme on it. I have noticed that Wordpress adds <p> tags all over the page. Do you know any plugin or a workaround to avoid this?
...
Hello,
I am trying to connect to Yudu's web service via soap/php. When I send this test, I am getting the following fault response and code:
ERROR: env:Server-java.lang.RuntimeException: com.yudu.webservice.InternalError
If I dont specify a subscriptionId I get the following fault:
Client-SOAP-ERROR: Encoding: object hasn't 'subscrip...
I am looking for a generalised selector function that does the following:
$(".data").click(function(){
//insert proper selector
)};
<div class="one">
<div class="data">text</div>
<div class="data">text</div>
<div class="data">text</div>
</div>
<div class="two">
<div class="data">text</div>
<div class="data">text</div>
<div class="d...
I've got a site where all the pages are php scripts, so the URLs end .php.
I've added the following to a .htaccess file, and I can now access the .php files without the .php extension:
RewriteEngine On # Turn on rewriting
RewriteCond %{REQUEST_FILENAME}.php -f # If the requested file with .php on the end exists
RewriteRule ^(.*)$ $1...