Hi All
I'm having problems printing a string with a % char. Here is the code
line = sprintf("<table width=100% id=%s>\n", $table_id);
I'm getting an not enough parameter error. The % for the 100% is being
mis interepreted as a format char. Though i worked around by coding it
line = sprintf("<table width=100%s id=%s>\n", '%', $table_id);, i think
there should be a way with which the % can be escaped PHP.
The PHP documention does not have any info about this. if anyone has
come accross such problems and found a work around, please help me out.
Thanks
/V 6 2618
Double % sign.
sprintf("<table width='100%%' id='%s'>\n", $table_id);
-Jay
Venkat Venkataraju wrote: Hi All
I'm having problems printing a string with a % char. Here is the code
line = sprintf("<table width=100% id=%s>\n", $table_id);
I'm getting an not enough parameter error. The % for the 100% is being mis interepreted as a format char. Though i worked around by coding it line = sprintf("<table width=100%s id=%s>\n", '%', $table_id);, i think there should be a way with which the % can be escaped PHP.
The PHP documention does not have any info about this. if anyone has come accross such problems and found a work around, please help me out.
Thanks /V
Jay Moore wrote: Double % sign.
sprintf("<table width='100%%' id='%s'>\n", $table_id);
doesn't seems to work. it still asks for more parms. i also did \%, but
it is not working either.
/V
Venkat Venkataraju wrote: Jay Moore wrote:
Double % sign.
sprintf("<table width='100%%' id='%s'>\n", $table_id); doesn't seems to work. it still asks for more parms. i also did \%, but it is not working either.
/V
Works just fine for me. Make sure you don't have any typos.
-Jay
Venkat Venkataraju wrote: Hi All
I'm having problems printing a string with a % char. Here is the code
line = sprintf("<table width=100% id=%s>\n", $table_id);
I'm getting an not enough parameter error. The % for the 100% is being mis interepreted as a format char. Though i worked around by coding it line = sprintf("<table width=100%s id=%s>\n", '%', $table_id);, i think there should be a way with which the % can be escaped PHP.
The PHP documention does not have any info about this. if anyone has come accross such problems and found a work around, please help me out.
Thanks /V
If it's anything like C++ (as PHP usually is), and if I remember my c++
correctly, it's going to be %%. Try that.
-- Inuyasha4Life
In message <h1*********************@newssvr28.news.prodigy.co m>, Venkat
Venkataraju <segfault@?.?.invalid> writes Hi All
I'm having problems printing a string with a % char. Here is the code
line = sprintf("<table width=100% id=%s>\n", $table_id);
I'm getting an not enough parameter error. The % for the 100% is being mis interepreted as a format char. Though i worked around by coding it line = sprintf("<table width=100%s id=%s>\n", '%', $table_id);, i think there should be a way with which the % can be escaped PHP.
The PHP documention does not have any info about this. if anyone has come accross such problems and found a work around, please help me out.
You have a percent literal in the line. You can just concatenate it:
line = "<table width=100% id=" . $tableid . ">\n";
--
Five Cats
Email to: cats_spam at uk2 dot net
Venkat Venkataraju <segfault\"@\"nospam.sbcglobal.net> wrote: line = sprintf("<table width=100% id=%s>\n", $table_id);
This will work:
line = sprintf("<table width=100%s id=%s>\n", '%', $table_id);
--
Spam is spam no matter who's doing it or for what reason. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Illuzioner |
last post by:
hey all,
can anyone enlighten me on the proper c++ way to print formatted text into a
string?
e.g.
string mytext;
double nn=445566.332211;
|
by: huey_jiang |
last post by:
Hi All,
I am trying to figure out a right syntax to convert an integer array
into hex array. sprintf worked for me on doing single integer:
int i, Iarray, n=15;
char buf;
sprintf(buf,...
|
by: junky_fellow |
last post by:
Consider an implementation that doesn't use all bits 0 to represent
a NULL pointer. Let the NULL pointer is represented by 0x12345678.
On such an implementation, if the value of NULL pointer is...
|
by: babak |
last post by:
Hi everyone
I want to format a string (using sprintf) and put it in a messagebox
but however I try to do it, it doesn't seem to work.
Here is an example sample of what i try to do:
char msg;...
|
by: Neal Barney |
last post by:
I have a C program which runs on a device using a Zilog Z180
microprocessor. While it can address 1MB of RAM, it can only address
64KB at any given time. And of that only 16KB can be used for...
|
by: bwaichu |
last post by:
Now, I read the faq, and it suggests using sprintf. However,
I want to all ways know where the integer finishes in the string.
Basically, I want to:
nbr | other data
But the other data all...
|
by: mac |
last post by:
Hi,
I'm trying to write a fibonacci recursive function that will return
the fibonacci string separated by comma. The problem sounds like this:
-------------
Write a recursive function that...
|
by: 2b|!2b==? |
last post by:
I am not making much progress porting some old C code to C++ ...
I am porting the lines below, which prints an ISO8601 date string:
char buff ;
memset(buff, '\0',16);...
|
by: nospam |
last post by:
If I have a string say:
myvar = "This is a string";
How do I use sprintf to convert the string so it has 4 spaces padded on
the left like:
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |