Jump to content

PHP version 50


extrovertive

Recommended Posts

[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?
Link to comment
Share on other sites

[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 have

For example
A basic example would be nl2br()
That is basicly sayig

function 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. :)
Link to comment
Share on other sites

[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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This is going slighly off topic tho

I 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
Link to comment
Share on other sites

[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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

Yes, while on the subject, what is 'real'... How about the fork you're holding, is that real?  :P

Whahahahahhahhaaaa.... 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.... :P

Go on, I could use another good laugh...

Phewey, I break myself up... Time to catch my breath.  :D
Link to comment
Share on other sites

[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]<?php
function my_nl2br($string)
{
return preg_replace("/(\r\n|\r|\n)/","<br />",$string);
}
?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.