473,672 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: getting parameters to send then to another function

..oO(Newsgroups )
>My goal is to have a unique function with undeterminated number of
parameters witch return the sprintf result.

<?php
print test("key", "key2");
function test($k)
{
return sprintf("test %s %s", $k);
}
?>

So, in this case, when we are calling test() function, we need 2 parameters
because sprintf require 2 "%s"...
Why sprintf()? Why not simply implode() all parameters?
>but I don't know how to send the test() parameter's into the sprintf's ones
...
Have a look at func_get_args() and the like.

Micha
Sep 23 '08 #1
0 1499

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6646
by: bearclaws | last post by:
I am trying to send URL parameters from an HTML page to an XSL page. I used this script to pass parameters manually to the XSL and it works great. I just modified the "input for XSL-processor" section: http://www.biglist.com/lists/xsl-list/archives/200107/msg00002.html However, I'd like to be able to build that parameter list dynamically. So far, I can get the parameters into an array and pass the values to the loadXML function;...
6
1799
by: simon | last post by:
Always when I need data reader in my programs, I simply have functions, which creates it for me: Dim rdr As SqlDataReader dim sql as string sql="myStoredProcedure" rdr = createDataReader(sql, False) And the functions are:
0
5500
by: lglmi | last post by:
'********************START OF BAS MODULE******************** Option Explicit Private Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long
15
2959
by: sara | last post by:
Hi I'm pretty new to Access here (using Access 2000), and appreciate the help and instruction. I gave myself 2.5 hours to research online and help and try to get this one, and I am not getting it. Simple database: I want to have a user enter Supply Orders (just for tracking purposes) by Item. The user may also enter a new item - "new" is a combination of Item, PartNumber and Vendor - they could have the
1
3404
by: Julia | last post by:
Hi, I have been asked this before but I think that I didn't explain myself well I am using exception and logging and I would like to log the parameters which was passed to the function whenever an exception was occurred,again,I want to emphasize that I am the owner of the code. I can see that idlasm can view the content of an assembly so I wonder why my
11
2990
by: Simon Wigzell | last post by:
My website sends automatic emails from many (25) different places. I want to send a second email by reading the parameters of the first one. I don't want to have to repeat and maintain the assignment of the second email From,To,Subject fields so I am just using an include at each point in the code where I send an email: Set MyCDONTSMail = CreateObject("CDONTS.NewMail") MyCDONTSMail.BodyFormat= 0 MyCDONTSMail.MailFormat= 1...
7
11277
by: Aaron Gray | last post by:
I put together the following code to get the href's parameters :- function GetParameters() { var arg = new Object(); var href = document.location.href; if ( href.indexOf( "?") != -1) { var params = href.split( "?");
3
1929
by: TC | last post by:
Hey All, I have some classes that I recently built for a website which uses the HttpWebRequest & HttpWebResponse objects from the System.Net namespace. Basically, the classes rap submitted data up, connect to external websites on external servers and post / remove the data from these other sites. It works fine locally but when uploaded to the BCentral production server, the outgoing requests get shutdown.
3
1310
by: harry.viet | last post by:
I use the prototype library and create a class that builds a grid using some parameters as mentioned below. Everything is working but only the parameters for Number formatting var gridopts = { iPageSize : 100, dataSource : '../data/ledgergetdata.asp', dataPars : { acct_type : '2' }, columns : }, { name: 'credit', field : 'credit', width: '10%' ,
0
395
by: FutureShock | last post by:
Newsgroups wrote: Your best bet would probably be to pass the function an array of your variables and then extract them inside the function for use. Remember that you have to pass the same number of parameters into the function as what it was designed for. Your function above would fail as the $key2 would not make it inside the function.
0
8500
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8943
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6254
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5719
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4238
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4437
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2835
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.