What does sprintf stand for?
Hi everyone, I tried looking it up on google and wikipedia but couldn't find an answer... Does anyone know what 'sprintf' or 'printf' stands for? Is it an abbreviation for something??? Thanks ...
Hi everyone, I tried looking it up on google and wikipedia but couldn't find an answer... Does anyone know what 'sprintf' or 'printf' stands for? Is it an abbreviation for something??? Thanks ...
I am using CakePHP 1.3 and it keeps telling me the following. Cannot modify header information This ONLY happens when I include the Auth component. var $components = array('Auth'); Am I doing something wrong, a bug, or what? ...
I'm forking with this code: echo "1. posix_getpid()=".posix_getpid().", posix_getppid()=".posix_getppid()."\n"; $pid = pcntl_fork(); var_dump($pid); if ($pid == -1) die("could not fork"); if ($pid) { //parent echo "2. pid=".$pid.", posix_getpid()=".posix_getpid().", posix_getppid()=".posix_getppid()."\n"; } else { //child $sid = posix...
Hi all. I am building a template parser. The template parser works like this: Tokenize (make for each part of the template code a token) Parse Use my ParserHelper class. You can add rules for this system, and then it checks the token list for a valid grammar. Add / change some tokens for extra functionality Compile (translate to php ...
Assuming I have this string: "abc{def{ghi{jkl}mno{pqr}st}uvw}xyz" and I want to match this: "{def{ghi{jkl}mno{pqr}st}uvw}" what should my regular expression look like..? In other words, the match should start with "{" and end with "}", but it must have as many {'s as }'s in between. ...
I'd like to be able to pull the first X words from a database field for use in a preview. Basically if a field 's content was "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris malesuada." I would like to echo "Lorem ipsum dolor sit amet... see more" What's the best way to do this? The only thing I know to do is p...
There is a contact form which current action is "http://www.siteA.com/ContactInfo.php", it sends fields and values. In ContactInfo.php, i just catch the values and send and email to [email protected] BUT, inside ContactInfo.php, I need to send the same data to another destination, in other domain http://wwws.SiteB.com/Reg.aspx I have tryed out to...
[ Status: Learner ] I am attempting to implement a parameterized query but I am having problems. Jonathan Sampson recently hinted at how this could be done (#2286115), but I'm not following his suggestion correctly. Here is my script $cGrade = "grade" ; include_once ( "db_login.php" ) ; $sql = "SELECT last_name AS last_name ...
I want to grab a php file, evaluate any php, then store the contents in a variable. We'll call this.. page.php <?php $content = "Hello World."; ?> <html> <head> <title><?php echo $content ?></title> </head> <body> <?php echo $content ?> </body> </html And I want to put that into a variable by calling a function from another file. ...
i dont undestand the () in regexp. eg. what is the difference between these lines: "/hello/" "/(hello)/" ...
I'm looking to limit to the first 5 results returned here. This works, but it does not limit the data set: <?php foreach($sxml->status as $status){ $name = $status->user->name; $image =$status->user->profile_image_url; $update =$status->text; $url = "http://twitter.com/" .$status->user->screen_name; echo "<li><a href=\"" . $url . "\"...
Hi All, I am new to Iphone development , I want to create an application in which I have to upload some data on php server using my Iphone application. For this I have an file on the Iphone whose content I have to upload on php server. For this I have converted the content of the file in NSData and now I want to encrypt this nsdata obje...
What's wrong with this code?I'm currently calling the code below using a link. Is there anything else needed for this to work? The error is specifically in this line: $backupdir = 'C:\wampbackup\x.sql'; What might be a possible solution to this. I'm a beginner so please bear with my lack of knowledge. $host= 'localhost'...
I have a from location (latitude, longitude) and to location (latitude, longitude). After calculating, it should show me what would be the nearest way to go from using a compass. The following is PHP code to do that, but its showing the wrong direction, I need little help on this. function GreatCircleDirection ($OrigLat, $DestLat, $Orig...
If you are uploading something like Zend Framework using poor internet conneciton it may be problematic. I think the compression of the catalog is the best solution. But what compression system is the best for this task ? We are using PHP, of course. I have some ideas like PHP + exec + unrar and http://www.php.net/manual/en/refs.compre...
i want to get the word Asarum in the below line: <A HREF="http://www.getty.edu/vow/TGNFullDisplay?find=&place=&nation=&english=Y&subjectid=1062783">Asarum</A> i tried with: preg_replace('/<a.*?>/i', '', $link); preg_replace('/<\/a>/i', '', $link); echo $link; but it doesn't work. nothing was cut out. coul...
I followed the following tutorial to build a multilingual webpage using php arrays: http://bytes.com/topic/php/answers/880915-how-develop-multi-lingual-websites-php the code: files tree: locale/ english.php french.php set_locale.php index.php locale/english.php: <?php $locale = array( 'title' => 'Title in English', ...
I have fax numbers and I would like to to send a fax message to each of the numbers programatically. What is the code to send fax message using PHP? ...
Hi, regarding file uploads, I have a form through which I upload a file, I get the $temp_name = $_FILES['name']['temp_name'] and store it in a variable. Can I then use that variable again inside move_uploaded_file("$temp_name","$location") inside another form. Will this work?? When we upload a file, there is a temp location created o...
I have the following code: <html> <head> <title><?php echo $GLOBALS['L']['title']; ?></title> </head> <body> <ul id="language-selection"> <li><a href="index.php?lang=english">English</a></li> <li><a href="index.php?lang=french">French</a></li> ...