PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 24th, 2013, 12:14 PM
rePete rePete is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2006
Posts: 658 rePete User rank is Sergeant Major (2000 - 5000 Reputation Level)rePete User rank is Sergeant Major (2000 - 5000 Reputation Level)rePete User rank is Sergeant Major (2000 - 5000 Reputation Level)rePete User rank is Sergeant Major (2000 - 5000 Reputation Level)rePete User rank is Sergeant Major (2000 - 5000 Reputation Level)rePete User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 3 h 47 m 13 sec
Reputation Power: 30
How do you connect strings and variables together??

I am working with Wordpress and I am trying to do a redirect.

It can accept a string in a function I am trying to use it for: wp_redirect('?page_id=9'); exit();

But the 9 part, I am retrieving from the database as a variable called $pageNo.

I have tried the following but to no avail!

wp_redirect('?page_id=$pageNo'); exit();

echo 'wp_redirect(\'?page_id='.$pageNo.'\'); exit();';

$myPage = "'?page_id=".$pageNo."'";
wp_redirect($myPage); exit();

I have tried other combinations as well.

Is this possible. Is there a way to store this whole line
'?page_id=$pageNo'
into a variable as a string, including the quotes so that I can just place the variable into wp_redirect($String);

Thanks

Last edited by rePete : January 24th, 2013 at 12:18 PM.

Reply With Quote
  #2  
Old January 24th, 2013, 12:25 PM
gw1500se gw1500se is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,885 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 2 Weeks 3 Days 8 h 17 m 9 sec
Reputation Power: 581
I'm not familiar with Wordpress but in PHP in general substitution is not done within single quotes.
PHP Code:
 wp_redirect("?page_id=$pageNo"); exit(); 

P.S. Note the use of [ PHP ] tags. See the sticky at the top of this forum.
__________________
There are 10 kinds of people in the world. Those that understand binary and those that don't.

Reply With Quote
  #3  
Old January 24th, 2013, 12:58 PM
Nanomech's Avatar
Nanomech Nanomech is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Location: The Pleiades
Posts: 196 Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 23 h 53 m 4 sec
Reputation Power: 7
Send a message via Skype to Nanomech
I've always been told it is best practice to put any variables within curly braces if placed within a string. How true this is I don't know but I choose this method 99% of the time:
PHP Code:
 wp_redirect("?page_id={$pageNo}"); exit(); 


There are many many ways to do it though.

Hope this helps.

Regards,

NM.
__________________
"WERE NOT WORTHY!"
"WERE NOT WORTHY!"

Reply With Quote
  #4  
Old January 24th, 2013, 05:23 PM
f_razzoli f_razzoli is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Location: Italy
Posts: 36 f_razzoli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 48 sec
Reputation Power: 1
Of course there is not a "best way", but I prefer doing so:

"bla bla" . (string)$myNumber

because usually newbies don't really understand what happens if we use a shorter syntax.
Comments on this post
Nanomech agrees: I like that also, is probably the best way actually! ty

Reply With Quote
  #5  
Old January 24th, 2013, 06:47 PM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,811 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 19 h 13 m 52 sec
Reputation Power: 6112
With PHP, there are many "correct" ways of doing things. There are people who will argue that one is faster. They are correct, technically. One is nanoseconds faster than the other, and proving which is an exercise left up to the reader, or to someone who can google the last time I proved it.

The correct ways:

PHP Code:
 $a '123' $abc;
$a "123{$abc}";
$a '123' strval($abc); //unnecessary
$a '123' . (string)$abc//unnecessary
$a sprintf('123%s'$abc); //the C and C++ way, overly complex
$a implode(array('123'$abc)); //Just silly, don't do this. 
In addition to these ways, there's a special way. echo accepts a comma-delimited list of arguments without needing parentheses:

PHP Code:
echo 'abc'$def'123'
Weird, I know.

Anyway, the official spec/standard says to use the "123{$abc}" method. So just do that.. Note the double quotes.

The PHP manual page on strings has more information if you're interested.
__________________
HEY! YOU! Read the New User Guide and Forum Rules

"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

Reply With Quote
  #6  
Old January 24th, 2013, 06:58 PM
f_razzoli f_razzoli is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Location: Italy
Posts: 36 f_razzoli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 48 sec
Reputation Power: 1
Quote:
Originally Posted by ManiacDan
PHP Code:
echo 'abc'$def'123'
Weird, I know.


This is the only way that is fast enough to say "this is faster". All other ways are not faster, or at least, the randomness of benchmark results is much much much higher than the performance difference you can measure

The reason why echo $a, $b is faster is obvious and valid in ALL programming languages: concatenating a string can be a string has a cost.

But still, this has some relevance only if you are printing ENORMOUS strings.

Reply With Quote
  #7  
Old January 25th, 2013, 04:10 AM
rePete rePete is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Sep 2006
Posts: 658 rePete User rank is Sergeant Major (2000 - 5000 Reputation Level)rePete User rank is Sergeant Major (2000 - 5000 Reputation Level)rePete User rank is Sergeant Major (2000 - 5000 Reputation Level)rePete User rank is Sergeant Major (2000 - 5000 Reputation Level)rePete User rank is Sergeant Major (2000 - 5000 Reputation Level)rePete User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 3 h 47 m 13 sec
Reputation Power: 30
Thanks Guys!

The quote things is a little confusing to me. So, in general, should I learn to use double quotes " when I am referring to a string inside brackets??
eg.
url("http://www.blah.com");

and with echos, I use single quotes??
echo '<p>hello</p>';

Thanks for enlightening me on this. I don't understand why there is not one coding standard?? Why not one language?? Why have php, mySQL, html, etc.

Reply With Quote
  #8  
Old January 25th, 2013, 07:02 AM
gw1500se gw1500se is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,885 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 2 Weeks 3 Days 8 h 17 m 9 sec
Reputation Power: 581
Not quite. Brackets have nothing to do with it. Strings in general should be using double quotes. Single quotes are used when you have a lot of special characters in the string. Special characters in a double quoted strings need to be escaped (\) but not in single quotes. IMO it is mostly for readability.
PHP Code:
echo "<div id=\"divid\" name=\"divid\" align=\"center\">"

vs
PHP Code:
echo '<div id="divid" name="divid" align="center">' 

Reply With Quote
  #9  
Old January 25th, 2013, 07:46 AM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,811 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 19 h 13 m 52 sec
Reputation Power: 6112
Single-quoted strings are not examined or interpolated. If you put:
'123 {$abc} \t'

That is literally what you will get. If, however, you changed those to double quotes, {$abc} will be replaced with the value of variable $abc, and \t will be replaced with a tab.

As for escaping, you only need to escape characters which match the surrounding quotes. If you don't want to end your string, escape it:

'It\'s as easy as 123!';

"Then my mom said \"Clean your room!\"";

Characters still need to be escaped in both quoting types, specifically the quotes and backslashes.

Reply With Quote
  #10  
Old January 25th, 2013, 08:35 AM
NotionCommotion NotionCommotion is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2006
Posts: 1,464 NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 6 h 21 m 36 sec
Reputation Power: 526
I either never knew or forgot what the curly brackets were used for in strings. I typically only use single quotes. Funny that I haven't come across the curly quotes in someone else's code and been forced to figure out what they meant. Do many of you use them? Regardless, to speed, they are effectively all the same.

PHP Code:
<?php
    $time0 
microtime(true);
    
$abc="hello";
    for (
$i 1$i <= 100000$i++)
    {
        
$a=$i;
        
//echo ('123' . $abc);  //Method 1
        //echo("123{$abc}");    //Method 2
        
echo '123'$abc;       //Method 3
    
}
    
$time1 microtime(true);
    echo(
'<br>'.($time1 $time0));

?>

Reply With Quote
  #11  
Old January 25th, 2013, 09:30 AM
gw1500se gw1500se is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jul 2003
Posts: 2,885 gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level)gw1500se User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Year 2 Weeks 3 Days 8 h 17 m 9 sec
Reputation Power: 581
Using curly braces is pretty rare. Off the top of my head I can't think of a situation where they are necessary.

Apologies for hijacking this thread.

Reply With Quote
  #12  
Old January 25th, 2013, 10:11 AM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,811 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 19 h 13 m 52 sec
Reputation Power: 6112
The coding standard says you should always include the curly braces. They're necessary for any time a variable isn't followed by a space, as in:
echo "The history of the {$century}s";

They also help code highlighters highlight properly, as most won't properly handle:
echo "The first element is $arr[0]";

PHP will handle more sloppy coding styles well, that's why it's designed the way it is. The "official" recommendation is to use the "complex syntax" always, though the "simple syntax" (without the braces) is alright for very simple scalars and object properties. The manual entry on string parsing discusses it more in depth, and provides examples of how you can be easily bitten by using the "simple" syntax.

Reply With Quote
  #13  
Old January 25th, 2013, 10:22 AM
NotionCommotion NotionCommotion is offline
Contributing User
Click here for more information.
 
Join Date: Sep 2006
Posts: 1,464 NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level)NotionCommotion User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 6 h 21 m 36 sec
Reputation Power: 526
This has been a good post for me. Thanks rePete for starting it!

Reply With Quote
  #14  
Old January 25th, 2013, 03:17 PM
Nanomech's Avatar
Nanomech Nanomech is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Location: The Pleiades
Posts: 196 Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level)Nanomech User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 23 h 53 m 4 sec
Reputation Power: 7
Send a message via Skype to Nanomech
Agreed I've learnt a couple of things about strings since reading this thread.

Although I never escape values with backslashes. Let's say I want to print an image, I'd write:
PHP Code:
<?php

$img 
"phpwp.jpg";

echo 
"<img src='{$img}' alt='PHP logo' />";

?>


Regards,

NM.

Reply With Quote
  #15  
Old January 25th, 2013, 07:53 PM
ManiacDan's Avatar
ManiacDan ManiacDan is offline
Likely to be eaten by a grue.
Dev Shed God 10th Plane (9500 - 9999 posts)
 
Join Date: Oct 2006
Location: Pennsylvania, USA
Posts: 9,811 ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)ManiacDan User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1Folding Points: 127430 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 2 Months 3 Weeks 19 h 13 m 52 sec
Reputation Power: 6112
yeah, but what if you wanted to print an image with the alt text:
Quote:
visit our "About us" page


You would have to escape one or the other.
Comments on this post
Nanomech agrees: I see your point, I've never printed a string which needed to be quoted. I'll play with this now!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > How do you connect strings and variables together??

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap