Stupid question, but does anyone know how to load google's jquery from an external script so it doesnt clunk up my header? In other words, I want to take the code below (probably starting at the google.load stuff and save it inside another file to include in my header. I want to keep my view source pretty :)
<script src="http://www.goog...
Hello,
I made my first project with ZF, used the Zend_Tool component.
For the index controller a created some actions, and they work well.
But my question is, when do you create a new controller?
thanks!
...
I have this controller which will simply change the language in a session so I can set it in the bootstrap.
Except I want to change '$this->_redirect ( 'library/recipes/list' );' to be the URL of the page they are on. Ive tried a few functions and they dont seem to work.
Im a newbie Zend user, thanks!
class Library_LanguageswitchCon...
I want to take out the text in the bottom of an image. How can i cut it from bottom ...say 10px to cut from bottom.
I want do this in php, i have lots of images that have text in the bottom
Is there anyway to do it?
...
I found this code which will match at most 300 chars, then break at the next nearest word-break:
$var = 'This is a test text 1234567890 test check12.' # 44 chars
preg_match('/^.{0,300}(?:.*?)\b/iu', $var, $matches);
echo $matches[0];
44 is lower than 300, so I expect the output to be the same like $var.
But the output is:
This i...
Well it is more like a design question.
There are two ways I know to use joins in the Zend Framework
Deal with it using instance of Zend table( its Select obj)
Deal with it using the instance of Zend Db (its Select obj)
in the first approach it seems really strange to me - the some table have to be dealing with other tables too, whic...
I would like to redefine certain functions in PHP that are already built for example, echo() or time() - I don't need to define these functions globally, just within a single script for testing.
I think this can be done in Perl but in PHP - Is this possible?
Thanks all for any help.
...
I've got an html table that is being generated with php.
This list can have records of over 20000 records, so I added a paging on this list.
In this list you can modify the rows you like, when you hit save, it saves the changes in a temp table and only after you hit apply changes, the actual changes are applied in the main table. Befor...
$constPrefix = '_CONST_';
if (strstr($content, $constPrefix)) {
$constants = array('PHP_VERSION', '__FILE__');
foreach($constants as $constant) {
$constantOutput = eval($constant);
$content = str_replace($constPrefix . $constant, $constantOutput, $content);
}
}
Basically, just trying to parse some content a...
I've already installed php, fcgi, nginx, the system running as no problem, but the problem happen when:
I update memory_limit in php.ini, then restart php-cgi, nginx, but when use phpinfo, theo memory_limit is not effected.
I install 2 new extensions: curl and memcache, add 2 lines: extension=curl.so and extension=memcache.so, restart ...
I've wrote a query to check for users with certain criteria, one being they have an email address.
Our site will allow a user to have or not have an email address.
$aUsers=$this->readToArray('
SELECT `userID`
FROM `users`
WHERE `userID`
IN(SELECT `userID`
FROM `users_indvSettings`
WHERE `indvSettingID`=5 AND `optionID...
i need to parse this php xml response in android:
<?phpxml version="1.0" encoding="utf-8"?>
<SmsResponse>
<version>1</version>
<result>0</result>
<resultstring>failure</resultstring>
<description>error</description>
<endcause></endcause>
</SmsResponse>
...
While trying to run a string through PHP's htmlentities function, I have some cases where I get a 'Invalid Multibyte Sequence' error. Is there a way to clean the string prior to calling the function to prevent this error from occuring?
...
From an array
$my_array = array('a','b','c','d','e');
I want to get two DIFFERENT random elements.
With the following code:
for ($i=0; $i<2; $i++) {
$random = array_rand($my_array); # one random array element number
$get_it = $my_array[$random]; # get the letter from the array
echo $get_it;
}
it is possible to g...
How can I take all the attribute of an element? Like on my example below I can only get one at a time, I want to pull out all of the anchor tag's attribute.
$dom = new DOMDocument();
@$dom->loadHTML(http://www.example.com);
$a = $dom->getElementsByTagName("a");
echo $a->getAttribute('href');
thanks!
...
Hi guys. I work with DbSimple in my site-engine. Everything worked fine but some time ago I began to get an error:
Deprecated: Assigning the return value of new by reference is deprecated in Z:\home\localhost\www\ololo\DbSimple\Generic.php on line 113
Deprecated: Assigning the return value of new by reference is deprecated in Z:\home\...
Hello,
I've been trying to learn how to use PHP sessions but I'm going around in circles.
I understand that a session cookie can be given a lifetime ('session.cookie_lifetime') and that after that lifetime the cookie expires regardless of if a user interacts with the site. I would therefore assume to set this to 0 to indicate they should...
I'm looking to run some kind of loop on some optional XML data.
Nodes would potentially look like this:
<link1>
<url>http://www.bleh.com</url>
<text>Click here</text>
</link1>
<link2>
<url>bleh.com</url>
<text>Click here</text>
</link2>
What would be the best method to determine if these nodes exist and parse them according...
How I can parse a domain from URL in PHP? It seems that I need a country domain database.
Examples:
http://mail.google.com/hfjdhfjd/jhfjd.html -> google.com
http://www.google.bg/jhdjhf/djfhj.html -> google.bg
http://www.google.co.uk/djhdjhf.php -> google.co.uk
http://www.tsk.tr/jhjgc.aspx -> tsk.tr
http://subsub.sub.nic.tr/ -> nic.tr
ht...
If you run a phpinfo(); does it show exactly what is in the php.ini or if settings are changed on the fly via php with methods like ini_set() or via .htaccess will they be shown in phpinfo?
...