extrovertive Posted September 22, 2006 Share Posted September 22, 2006 As more and more functions are built-into PHP with new releases, there will be only several functions to use when it gets to version 50...createmybusiness_site(title, pages)createmyhome_page()and more.... Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/ Share on other sites More sharing options...
neylitalo Posted September 23, 2006 Share Posted September 23, 2006 [quote author=extrovertive link=topic=109038.msg439239#msg439239 date=1158915919]As more and more functions are built-into PHP with new releases, there will be only several functions to use when it gets to version 50...createmybusiness_site(title, pages)createmyhome_page()and more....[/quote]If you're saying that they'll start integrating the functionality of PHP into a few simple functions that'll do it all for you, then I certainly hope not. (I also disagree.) You would lose all flexibility, and I'm sure the people responsible for PHP have no desire to do that. They don't benefit from it, we don't benefit from it, the users don't benefit from it. All that and the fact that PHP would be quite and completely useless.Or am I missing something? Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-97161 Share on other sites More sharing options...
onlyican Posted September 23, 2006 Share Posted September 23, 2006 the new functions added in PHP are standard function that use php programmers have created, now php haveFor exampleA basic example would be nl2br()That is basicly sayigfunction nl2br($str){$str = str_replace("\n", "<br>\n", $str);return $str;} Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-97423 Share on other sites More sharing options...
neylitalo Posted September 24, 2006 Share Posted September 24, 2006 [quote author=onlyican link=topic=109038.msg440124#msg440124 date=1159051102]the new functions added in PHP are standard function that use php programmers have created, now php haveFor exampleA basic example would be nl2br()That is basicly sayigfunction nl2br($str){$str = str_replace("\n", "<br>\n", $str);return $str;}[/quote]Well, technically, it'd be str_replace("\n", "<br />", $str);but yes, that is correct. :) Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-97483 Share on other sites More sharing options...
trq Posted September 25, 2006 Share Posted September 25, 2006 Actually it would be more like...[code=php:0]function nl2br($str) { $str = str_replace("\n","<br />\n",$str); return $str;}[/code]as linefeads are not actually replaced. Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-97959 Share on other sites More sharing options...
neylitalo Posted September 25, 2006 Share Posted September 25, 2006 [quote author=thorpe link=topic=109038.msg440687#msg440687 date=1159157512]Actually it would be more like...[code=php:0]function nl2br($str) { $str = str_replace("\n","<br />\n",$str); return $str;}[/code]as linefeads are not actually replaced.[/quote]gah! I stand corrected. Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-97977 Share on other sites More sharing options...
Daniel0 Posted September 25, 2006 Share Posted September 25, 2006 The snippet neylitalo showed is correct if it is saved as a Linux/UNIX file. If it is saved on Windows or Macintosh it isn't. Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-97986 Share on other sites More sharing options...
neylitalo Posted September 25, 2006 Share Posted September 25, 2006 Not even then - thorpe's is correct. If mine was correct, then if you ran nl2br on this:[code]asdfqwer[/code]it would come out as:[code]asdf<br />qwer[/code]However, in actuality, it comes out as:[code]asdf<br />qwer[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-97987 Share on other sites More sharing options...
trq Posted September 25, 2006 Share Posted September 25, 2006 yeah. nl2br doesnt replace new lines, merely adds a <br /> tag before it. However, Daniel0 is also partly correct in that windows, Linux and Mac all handle newlines differently. To replacate this function you'd need to use regular expressions which Im freaking hopeless at. Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-98289 Share on other sites More sharing options...
onlyican Posted September 25, 2006 Share Posted September 25, 2006 This is going slighly off topic thoI just used it as an example for saying php are only adding "common" functions, not functions such as "buildmeawebsite()"I cant count the amount of times I have gone to build functions, and someone says, use this function by php Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-98346 Share on other sites More sharing options...
448191 Posted September 25, 2006 Share Posted September 25, 2006 [quote author=extrovertive link=topic=109038.msg439239#msg439239 date=1158915919]As more and more functions are built-into PHP with new releases, there will be only several functions to use when it gets to version 50...createmybusiness_site(title, pages)createmyhome_page()and more....[/quote]Not likey? Switch to assembly. Better yet, why not code binary, maybe you'll consider that 'real' programming. Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-98543 Share on other sites More sharing options...
Barand Posted September 25, 2006 Share Posted September 25, 2006 When I started programming you had to physically rewire pathways from the input to the storage registers and then to output and check for conditions to throw switches to reroute he wiring though a different route. Thats real programming! All this digital stuff is a piece of cake compared to that.And yes, in case of power failure, I have an abacus in the office. Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-98615 Share on other sites More sharing options...
onlyican Posted September 25, 2006 Share Posted September 25, 2006 Dont kill me hearI dont considor PHP "Real Programming"I love php, but I considor it Web Programming, not Real ProgrammingPHP is famous for the following reasonsAffordable (Well its Free)Easy to learnEasy to understandGreat Resources around for it Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-98627 Share on other sites More sharing options...
neylitalo Posted September 26, 2006 Share Posted September 26, 2006 care to share your definitions of "Web Programming" and "Real Programming"? Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-98817 Share on other sites More sharing options...
448191 Posted September 26, 2006 Share Posted September 26, 2006 Yes, while on the subject, what is 'real'... How about the fork you're holding, is that real? :PWhahahahahhahhaaaa.... This kind of pointless discussions can break me up sometimes, pardon my sense of humor... ;D"The Matrix IV: Web programming, is it real?" Whahahahahahhaha....I guess next someone is going to say php is a scripting laguange, and programming and scripting is soooooooooo much two different things... And don't say programming is something 'lower level', because programming my remote control isn't exactly considered lower level... WHAHAHAAHA.... :PGo on, I could use another good laugh...Phewey, I break myself up... Time to catch my breath. :D Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-98953 Share on other sites More sharing options...
Daniel0 Posted September 26, 2006 Share Posted September 26, 2006 [quote author=thorpe link=topic=109038.msg441036#msg441036 date=1159200568]yeah. nl2br doesnt replace new lines, merely adds a <br /> tag before it. However, Daniel0 is also partly correct in that windows, Linux and Mac all handle newlines differently. To replacate this function you'd need to use regular expressions which Im freaking hopeless at.[/quote]This function would do it.[code]<?phpfunction my_nl2br($string){ return preg_replace("/(\r\n|\r|\n)/","<br />",$string);}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21638-php-version-50/#findComment-99011 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.