I am new to coding and would just like to know a bit more about frameworks. How does a framework help you code and what exactly is it? Such as Zend for php.
I want to run this function but show the result in a table row
strlen($cat_row['sms']
This is what i came up with but it is not working:
echo "<tr><td bgcolor=#626E7A>".**strlen($cat_row['cars']**."</td></tr>";
How do you show result of a php function in a table row? i am trying to format the output some how.
please help
Money, Staff, Skill and preference to open source or commercial is neutral. Lets take the best of the best programmers (for arguments sake) and think about this:
What will perform better overall:
PHP & MySQL
or
ASP.Net & Microsoft SQL
(I don't want biased answers, just
looking for Performance, and Speed).
I have to build an application using Maven for PHP that has multiple modules.
The scenario in which the maven seems to not work is this: I have a common module and a client module depending on the first one.
When doing "mvn site" on the client module which depends on the common module, the test fails to see the paths to the common module. Is there a flow in my build or this is just not possible?
Hey,
I'm working on some old(ish) software in PHP that maintains a $cache array to reduce the number of SQL queries. I was thinking of just putting memcached in its place and I'm wondering whether or not to get rid of the internal caching. Would there still be a worthwihle performance increase if I keep the internal caching, or would memcached suffice?
Hi All,
Using Reflection in PHP I can dynamically create a object like so
$target = 'core_domain_Person';
$reflect = new ReflectionClass($target);
$obj = $reflect->newInstance();
I would like to replicate this same concept in JavaScript is there a way to do this out of the box? Or is there a way to replicate what Reflection is doing?
Hello Friends!
I want to develop a shopping cart in php. I also want to integreate online payment facility using paypal.
Which allows payment thrugh credit card and decbit card.
So Please tell me how to integreate paypal in my own shopping cart to achive secure transaction?
Thank You!
When creating a Singleton in PHP, I ensure that it cannot be instantiated by doing the following:
class Singleton {
private function __construct() {}
private function __clone() {}
public static function getInstance() {}
}
However, I realised that defining a class as 'abstract' means that it cannot be instantiated. So is there anything wrong with doing the following instead:
abstract class Singleton {
public static function getInstance() {}
}
The second scenario allows me to write fewer lines of code which would be nice. (Not that it actually makes much of a difference.)
hi, i want only the first word of a variable.. example input:
<?php $myvalue = Test me more; ?>
the output should only "Test", the first word of the input.. how can i do this?
<?
if($id == 2) {
?>
html goes here
<?
}
else {
?>
if id is not 2 then something goes here
<?
}
?>
How can I write php+html in one file more beautiful without learning smarty?
Dear all,
I want to create multiple thumbnails using GD library in php, and I already have a script to do this, the question is what is better for me .. is it better to create thumbnail on the fly? or create a physical file on my server each time I want a thumb?? and Why?
Please, consider time consuming and storage capacity and other disadvantages for both
I tried this but only got a syntax error:
<?php
$a = true;
$str = <<< EOF
{$a ? 1 : 2}
EOF;
echo $str;
Is it possible to use such kind of conditional statement inside heredoc?
I have a directory that will be getting updated frequently, I want to display the last four images files uploaded, which match a certain pattern, on my php page.
Is this possible without having to perform a sort on every single image within the directory?
Many thanks!
<?php
function register_template(){
print_r(func_get_args());
# the result was an array ( [0] => my template [1] => screenshot.png [2] => nice template .. )
}
register_template( # unkown number of arguments
$name = "my template",
$screenshot = "screenshot.png",
$description = "nice template .. "
)
?>
BUT , I want the result array as $key = $value form , $key represents the parameter name.
Hi
I need to know how to get the first n words from text stored in my DB in PHP?
for example if there is some text in my DB like this one :
"word1 word2 word3 word4 text one test four five"
How I can get the first 4 or five words from this text?
Thnks in Advance.
I have a PHP script on a webserver.
This file is invoked via the shell by another program but it could still be run by the webserver in response to an HTTP request.
How can the script determine the way it was invoked?
I wrote a html scraper to scrape my various social identites, so I can make a real time 'biography' website.
However after using php curl_exec, I find that texts that I have quoted, end up being formatted in a weird character set.
ex: "I love dogs" gets formatted to ’I love dogs ’
"I hate cheese" gets formatted to “I hate cheese�
How do I either scrub these characters, or set curl not to format quotes like this.
Also, I have turned off magic_quotes.
I have a string which contains only numbers. Now I want to remove all leading 0s from that string
For example:
input: 000000001230
output: 1230
input: 01000
output: 1000
Is there any function in PHP/Zend for this?
Thanks
I need to return a JSON encoded response to a flash http get request.
In ASP.NET, I do this with a ASHX handler.
What's the PHP equivalent ?
I mean in order that I only get JSON back, and not the <html> etc.
I am thinking about setting the
php.ini, my.cnf and httpd.conf default charsets=UTF-8
The website is in swedish lang only.
I have some folders with special chars in them, also some files.
Is there any harm by doing this?
Is it cross-browser safe?
Thanks