AKB Forums

Go Back   AKB Forums > Technical sections > Languages, Compilers and Interpreters > Web Development
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Web Development Java/PHP/Perl/ASP and more

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Mar 29, 2003, 15:09   #1
Administrator
 
acid's Avatar
 
Join Date: Sep 2001
Location: South Korea, Gumi
Posts: 7,277
Blog Entries: 15
Rep Power: 10
Reputation: 372
' and "

What is the difference between using " and ' for string operations in PHP/Perl.
__________________

http://big-acid.blogspot.com/
acid is offline   Reply With Quote Quote selected
Old Mar 29, 2003, 17:12   #2
Moderator
 
Join Date: Mar 2002
Location: Ukraine
Posts: 123
Rep Power: 7
Reputation: 10
В PHP различие такое:
Variable parsing
When a string is specified in double quotes or with heredoc, variables are parsed within it.
There are two types of syntax, a simple one and a complex one. The simple syntax is the most common and convenient, it provides a way to parse a variable, an array value, or an object property.
The complex syntax was introduced in PHP 4, and can be recognised by the curly braces surrounding the expression.

На деле это выглядит так:
$test = 'test';
$s1 = 'this is the $test'; // this is the $test
$s2 = "this is the $test"; // this is the test

Использование " или ' сказывается на скорости. По поводу этого можно почитать статью "Оптимизация программ на PHP".
__________________
Життя - це не тільки будні © Nemiroff
hayk is offline   Reply With Quote Quote selected
Old Mar 30, 2003, 06:40   #3
Administrator
 
acid's Avatar
 
Join Date: Sep 2001
Location: South Korea, Gumi
Posts: 7,277
Blog Entries: 15
Rep Power: 10
Reputation: 372
Спасибо за инфу, кстати очень полезный сайт.
__________________

http://big-acid.blogspot.com/
acid is offline   Reply With Quote Quote selected
Old Mar 30, 2003, 09:21   #4
freelancer
 
Yerkanian's Avatar
 
Join Date: Jun 2002
Location: the same place
Posts: 592
Rep Power: 7
Reputation: 10
outdated, acid...
Yerkanian is offline   Reply With Quote Quote selected
Old Mar 30, 2003, 10:03   #5
В бой аргхххххххх!
 
hov's Avatar
 
Join Date: Sep 2002
Location: Vik, Medieval Norway
Posts: 1,497
Rep Power: 7
Reputation: 48
Send a message via ICQ to hov
Quote:
Originally posted by hayk
В PHP различие такое:
Variable parsing

. . .
На деле это выглядит так:
$test = 'test';
$s1 = 'this is the $test'; // this is the $test
$s2 = "this is the $test"; // this is the test
. . .

Baci dranic ' jamanak escaping chi arvum aisinqn
PHP Code:
echo 'es gnaci tun\nmarshrutkov'
talisa >>>
es gnaci tun\nmarshrutkov
isk
PHP Code:
echo "es gnaci tun\nmarshrutkov"
talisa >>>
es gnaci tun
marshrutkov
hov is offline   Reply With Quote Quote selected
Old Mar 31, 2003, 09:54   #6
Moderator
 
Join Date: Mar 2002
Location: Ukraine
Posts: 123
Rep Power: 7
Reputation: 10
hov
Это все написано в мануале. Не цитировать же его тут целиком.
__________________
Життя - це не тільки будні © Nemiroff
hayk is offline   Reply With Quote Quote selected
Old Mar 31, 2003, 11:18   #7
В бой аргхххххххх!
 
hov's Avatar
 
Join Date: Sep 2002
Location: Vik, Medieval Norway
Posts: 1,497
Rep Power: 7
Reputation: 48
Send a message via ICQ to hov
Quote:
Originally posted by hayk
hov
Это все написано в мануале. Не цитировать же его тут целиком.

Eto vopros ne ko mne....
i po-moemu voobshe ne k mestu
hov is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:21.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link