« first day (798 days earlier)      last day (4165 days later) » 

4:00 PM
@TheCOMPLETEPHPNewbie hiya
 
Anonymous
bored here
 
hey guys anyone know how to replace first 'p' from 'apple' sting in php?
 
Anonymous
regex^
 
Anonymous
maybe?
 
is there any predefined sting function in php
 
Anonymous
4:08 PM
why don't you use str_replace(); ?
 
it replace boh pp
 
@Sandeep use strpos to get the position of the p, then you can access the index of the string and change it.
 
i want to replace first p by o only
 
$string = 'apple';
$position = strpos($string, 'p');
$string[$position] = 'x';

var_dump($string); // => "axple"
 
Anonymous
what does $string[$position] = 'x'; mean?
 
4:12 PM
it means "write the character 'x' to the index of '$position' in the string '$string'"
 
Anonymous
is it an array?
 
hey thanks igorw
its work i have check this
 
no, a string is a string. you can use the same syntax that you use for array access to get individual characters of a string.
 
is there any php array function which sort array by ascending order without using the index?
 
note: in C, a string is indeed an array of characters. this is most likely what served as an inspiration for the syntax. however in PHP strings have their own dedicated type, and in fact there is no character type in PHP. characters are represented by single-letter strings.
 
Anonymous
4:17 PM
waw, never seen that before
 
@Sandeep have you looked for "sort" in the PHP manual?
 
Anonymous
So does this string manipulation technique eliminate the need for str_replace ??
 
@TheCOMPLETEPHPNewbie no. str_replace is useful when you want to replace all instances of a string with something else.
 
Anonymous
What if you had wanted to replace all characters though?

$string = 'apple';
$position = strpos($string, 'p');
$string[$position] = 'x';

What would be the equivalent of all in `$string[$position] = 'x'; `
 
4:30 PM
you mean replacing each p with an x?
 
Anonymous
No replacing apple with xxxxx
 
there's a few ways you could do that. either do the replace thing in a loop, like this:

$string = 'apple';
for ($i = 0, $length = strlen($string); $i < $length; $i++) {
$string[$i] = 'x';
}
 
@PeeHaa i cant believe its asked by 3.4k user
 
Another proof that rep means nothing :)
 
Or a better way to do it: $string = str_repeat('x', strlen($string));
@TheCOMPLETEPHPNewbie I suggest you read through the strings page in the PHP manual, and take a look at the string functions. ;-)
 
Anonymous
4:36 PM
Yea, I will thanks.
 
i am php developer
this is my blog ..
 
Anonymous
Sandy, if you don't know how to replace first character from a string, you shouldn't call yourself a php developer. I will let you share my name if you want
 
Anonymous
nice blog though
 
ya sure
 
4:44 PM
@Sandeep Just a note: Simply using classes doesn't make code OOP :)
Also you may want to format code as code on your blog
 
i am working on php .. develop various site
so i am php developer
 
try this
 
Hey @ "The" can you share your name?
 
@Sandeep you can click on the "The" to see his full username ;-)
 
@Sandeep also check formatting of article here .. try format your article something like that ... btw design is nice
@Sandeep instead of telling i am php developer please try like this is my blog review please ...
 
4:50 PM
i am seeing the "The" profile
@ null pointer thanks for suggestion
 
Anonymous
The COMPLETE PHP Newbie | That is my name
 
hi @Sandeep.
 
@ null pointer thanks for suggestion
 
Also @Sandeep what does this mean Use full file paths on include/require statements:?
 
yes @andho
i read "The" proifile
 
4:52 PM
full file paths meaning your code can only run on your system?
 
i am nice chat with you
 
@TheCOMPLETEPHPNewbie When to use "the" ....lol...:P
 
Also: "Pass unchanged variables to a function by reference rather than value:" <-- no!
 
@Sandeep we don't like people being wrong on the internet
aren't you a little new to this to be blogging about it
 
ya i am new in bloggin .. this is my blog
 
4:54 PM
"Ditch double quotes for single quotes:", "Use echo instead of print():" lolwut?
 
guys plase give your suggestion.. so i can improve my blog
 
@Sandeep I meant new to PHP
 
Anonymous
@NullPointer I am pretending to understand
 
I'm pretty sure I have a meme for that sort of thing
 
@PeeHaa whoa
 
Anonymous
4:55 PM
@andho has a .
 
@andho no .Not new to php .. i working from 2 year..
 
The VERY FIRST LINE of your PHP code (i.e. in your header page if you use one), you should put the following line.

`ob_start(‘ob_gzhandler’);` ???
 
Anonymous
@NullPointer are you referencing someone ?
 
@Sandeep PHP will always lose in a race against SQL and you should use this to your advantage. ......
 
Anonymous
I would love to test my near non-existent PHP skills against Sandeep's
 
4:57 PM
@TheCOMPLETEPHPNewbie yup ..at ..@Sandeep
 
Damn. My google skills are terrible ATM. The point it @Sandeep your "Speed Up Php" is about micro optimization. Please don't do that :)
 
ok
 
Also: one does not simply turns of error reporting in most cases. You would simply turn display_errors of and log_errors on
 
Anonymous
Damn I wish I was good at something particularly. Like, Sessions, Cookies, Arrays, or loops. I would brag and correct some people in here.
 
You got to be good at something. I mean you are doing a pretty decent job at trolling here in chat ;)
 
5:00 PM
@TheCOMPLETEPHPNewbie all of those are pretty basic, and you should master all of them ;-)
 
Anonymous
@PeeHaa please don't say that. I am not or ever have been trolling here.
 
Anonymous
If that is the way you see me, then I am sorry
 
@PeeHaa loleeeeeed ...haha
 
@TheCOMPLETEPHPNewbie Meh. As long as you don't ping me every 5 minutes with questions and don't flag stupid posts it's all fine by me
 
5:04 PM
guys i have to leave ..i will join tommarrow on same time
bye
 
@Sandeep
 
later @Sandeep
 
Sep 29 at 13:58, by Gordon
@hekko if you want to become an expert programmer, google SOLID, buy GOF, buy POEAA, buy Clean Code, lookup GRASP, DDD, CQRS, DCI … but dont ask for PHP books. That's the most reasonable suggestion I can give you when you ask for Expert PHP books really.
later
 
Anonymous
@PeeHaa I will never ping you. Be sure of that.
4
 
@PeeHaa did he ?
 
5:04 PM
^ Irony. Look it up ;)
 
@PeeHaa you can help me with this issue.
@TheCOMPLETEPHPNewbie LOL
 
@Lusitanian If I can I will :)
 
@PeeHaa the issue is that the jquery is not work
 
wont all the old php articles just get lost
guys seriously, rewrite old articles with new and correct information, contact authors of old articles to link to it
 
SO ChatBot, Your Browser
101 2 3
......^^^^^--lol...rlmone
 
5:08 PM
@Lusitanian Have you included the fixIt plugin?
 
@PeeHaa where can i fixit plugin?
 
$.fixIt('code that doeswnt work')
 
ah perfect
it works now
 
I knew it
I got that one from @webarto
 
Anonymous
Can anyone help me with PDO connection?
 
5:18 PM
@TheCOMPLETEPHPNewbie if you ask a specific question (as per room description) then maybe ;-)
 
Anonymous
I need to ask it in private. Some people just like to be a bully here
 
no one here actually bullies anyone besides tereško
 
Anonymous
^^ lol
 
and as long as you don't ping him he probably won't awaken
 
ping who? @tereško?
 
Anonymous
5:22 PM
noooooooooo
 
Anonymous
Please don't let that dude in here. All he does is make me contemplate suicide
6
 
hehe
@TheCOMPLETEPHPNewbie nooooooooooooooo.com
 
Anonymous
wtf? I didn't know they had a site for that. A good way to let the frustration out
 
tis a terrific site
 
@PeeHaa this is hilarious ... lol...:P
 
5:34 PM
:D
 
Anonymous
That is what I do, when I get syntax error, unexpected $end,
 
missing }
or {
its end so }
 
Anonymous
Yea, but I would be like in the picture
 
@TheCOMPLETEPHPNewbie let me guess, you want to be the emperor
 
Anonymous
$text = "let me guess, you want to be the emperor";

var_dump($text);
 
5:42 PM
@TheCOMPLETEPHPNewbie please press button once more nooooooooooooooo.com
lol
 
Anonymous
I like this one better. You gotta see it @NullPointer

http://www.youtube.com/watch?v=BRGTVvOfzjs
 
@TheCOMPLETEPHPNewbie damm you ... its ahhhhhhahhhhh..... should be with nooooooooooo
 
@igorw Though I don't think that it will be of interest for you as it's basically a translation of the presentation I sent you to PHP ;)
 
Anonymous
In turkish ahhhhhhhhh means nooooooooooo
 
5:49 PM
Also I hate it when I'm in a hurry and don't have time to proofread the stuff I wrote :/
 
@TheCOMPLETEPHPNewbie noop ...its really good article .. i do really appreciate your article ...
@NikiC noop ...its really good article .. i do really appreciate your article ... @TheCOMPLETEPHPNewbie it was a typo
 
Anonymous
@NullPointer you will see my articles one day. :)
 
@TheCOMPLETEPHPNewbie yupp i would like to see... yours too... and will appreciate your good article too
:)
 
Anonymous
Come on, don't you think I can teach total noobs about a thing or two in PHP? Atleast I could start by saying

start with <?php instead of <?

:)
 
lol.....
 
Anonymous
6:02 PM
A wise man once said "Knowledge is Knowledge no matter how small it is. "
 
A little learning is a dangerous thing;
drink deep, or taste not the Pierian spring:
there shallow draughts intoxicate the brain,
and drinking largely sobers us again.
4
by Alexander Pope (1688 - 1744)
 
Anonymous
hmmm..
 
6:23 PM
evening
 
@TheCOMPLETEPHPNewbie ^^
 
Anonymous
nooooooooooooooo.com
 
@NullPointer nice quote .. i had never looked up the full version
 
@tereško good evening
 
posted on December 22, 2012 by Nikita Popov

One of the large new features in PHP 5.5 will be support for generators and coroutines. Generators are already sufficiently covered by the documentation and various other blog posts (like this one or this one. Coroutines on the other hand have received relatively little attention. The reason is that coroutines are both a lot more powerful and a lot harder to understand and explain. In this ar

12
 
6:34 PM
@NikiC :D
 
@NikiC cool!
 
night
 
Anonymous
@NullPointer night
 
@PeeHaa needs a $uper::$tatic
Why is using a return generally considered better than using a global variable? — user319940 3 mins ago
no. no. NO!
 
a comment on a question answered by "Your Common Sense", how ironic.
 
and all people who answer (besides Col. Sh) just answer it the stupid way
 
user1125394
/me looking for a simple,light linux distribution in replacement of ubuntu
fedora - debian - arch Linux - linux Mint - elementaryOS - Mandriva?
 
user1125394
Linux XP is a discontinued fedora-based shareware Linux distribution designed to imitate Windows environment using GNOME desktop; it could run some Microsoft Windows programs using the Wine compatibility layer. Linux XP came with a graphical interface similar to Windows. Linux XP had to be registered within 99 boots after installation, or the OS would deactivate. References
 
user1125394
7:01 PM
not this one also :p it's not even free
 
user895378
1 hour ago, by NikiC
@igorw http://nikic.github.com/2012/12/22/Cooperative-multitasking-using-coroutines-in-PHP.html
 
user895378
^ Everyone should star that. Like, immediately.
 
user895378
@NikiC I didn't realize I was essentially compensating for the lack of coroutines with the iterator-based OO stream wrappers in Ardent. I'm going to update the relevant interfaces to stay more inline with your terminology ...
 
hey @rdlowrey
did you already read through it all?
 
user895378
@NikiC Yes.
 
7:07 PM
hum, just noticed that the last code sample was missing
added it now
 
user895378
I had a couple of thoughts, but I want to re-read it before I make any suggestions so I can be sure not to cover any ground that you addressed (in case I just missed it).
 
user895378
To the room: don't star the the message I linked, star the pinned message:
 
Yeah, I didn't address lots of stuff. The whole thing is probably a lot more complex than this
 
user895378
35 mins ago, by Feeds
posted on December 22, 2012 by Nikita Popov

One of the large new features in PHP 5.5 will be support for generators and coroutines. Generators are already sufficiently covered by the documentation and various other blog posts (like this one or this one. Coroutines on the other hand have received relatively little attention. The reason is that coroutines are both a lot more powerful and a lot harder to understand and explain. In this ar

 
Just the basic idea
 
user895378
7:09 PM
> IMHO PHP needs this low-level capability to stay relevant in a world with node.js things and websocket-style things.
 
user895378
1:1 mapping of process:request is good for some things, but not everything. Language-level coroutines will go a long way towards making PHP useful for the vague, nebulous "Web 3.0" that will almost certainly utilize websocket/comet/node-type communication en-masse.
 
I thought web 3.0 was going to be the semantic web? not that I care. :D
@rdlowrey have you looked at promises? imo node.js made a huge mistake when they moved away from them. error handling is such a mess in node...
 
user895378
web 3.0 is going to be whatever goofball marketing-types say it is :)
 
user895378
@igorw I have looked at them, but I'm not familiar with the internals of node. I agree with you that it's a mistake to move away from the futures/promises paradigm.
 
web 4.0 is going to be web 2.0 * 2
Twice the marketing BS.
 
user895378
7:18 PM
Forget linear, I'd say exponential growth :)
 
user1125394
web 4.0 neural web: it searches what's in your mind
 
user895378
I'm not totally sure what this means, but it sounds gangster as hell:
 
user895378
1 hour ago, by NullPointer
A little learning is a dangerous thing;
drink deep, or taste not the Pierian spring:
there shallow draughts intoxicate the brain,
and drinking largely sobers us again.
 
Drinking to get sober again? Let me try that
 
user1125394
7:29 PM
can you help me decide between mandriva - linux mint debian - fedora
 
user1125394
oops wrong link for mandriva it's mandriva.com/en/linux/overview (note they are still in 2011)
 
@NikiC You are right, of course, but I now know a lot more about how the platform really works - plus none of the "content script" modules really lend themselves very well to what we were doing - namely lifting an existing project and writing a wrapper for it, rather than actually porting it. They all end up executing stuff in the wrong context.
Evening all
 
good mornin @DaveRandom
 
If I disappear at some point or start posting nonsense it will be because I have fallen asleep and am face down on the keyboard.
 
7:43 PM
@DaveRandom Evening Davbe
 
how much is the age of (kids , childs , infants, baby ) perhaps and if there is more then that then how much perhaps their ages
 
Anonymous
Doesn't anyone know what kind of errors in php are ignored by default.
 
7:51 PM
Like... uhhmmm. idk.... none?
 
@TheCOMPLETEPHPNewbie Whatever you have it set to. php.net/manual/en/…
 
Yay free stars for reading the manual!
 
hi, can someone start my post please?
just wanna test it
 
Anonymous
@DaveRandom Sarcasm cost you a star.
 
Anonymous
7:55 PM
start my post ??
 
You know there isn't a 1 word limit per line here in chat right @Jasonw?
 
Anonymous
@Jasonw Make me laugh. I am so bored, and then I will star
 
Anonymous
peehaa lol..
 
@PeeHaa alrighty. thank you for telling.
 
np. Now you know
 
7:57 PM
@TheCOMPLETEPHPNewbie well, didn't you read on the doomday schedule?
brb, washroom
okay, that is cool tag
perhaps if u add a cross sign for delete , that would be awesome
 
user1125394
ok just 2 last candidates Fedora or LMDE which one?
 
It is mentioned in there, took me a little while to spot it but it is
@cyril Fedora says I, but it's a personal preference
 
user1125394
k
 
They are less prone to putting stuff in silly places and I like yum
 
> What skillsets will I acquire as a students if i learn assembly.
Mostly pendantry
 
:)
 
Oh, and "how to write assembler" I suppose
 
how to write performant C code.
 
Good for honing ones keyboard defenestration technique as well
 
user1125394
8:10 PM
ok from now I'll be a fedorian
 
How to write performant C code. Step 1. Why are you using C?
@PeeHaa can you bin those? Including the latest from @DaveRandom
 
user1125394

Sandbox

Where you can play with regular chat features (except flagging...
 
user1125394
@Lusitanian C not performant?
 
2 messages moved to recycle bin
Yay. Everybody is welcome in the recycle bin :D
 
Anonymous
8:13 PM
I saw the boogyman man
 
Anonymous
Why is mysql_ mysqli and PDO refered to as API's ?? Aren't they compiled in the PHP module together?
 
WHat do you think API stands for?
 
Anonymous
Well external extention of application that can integrate with other applications ??
 
API
Application Programming Interface
 
8:20 PM
Show off
Anyway that's wrong, it's Awesome PHP Interface
 
@TheCOMPLETEPHPNewbie Where did you get that definition from?
@DaveRandom looool
 
Anonymous
Well aren't facebooks developer tools API's?
 
Anonymous
@PeeHaa It made sense to me that way, for some reason.
 
Anonymous
I am wrong ?
 
@DaveRandom API = Applicable Pertinent Information, actually
 
8:22 PM
@TheCOMPLETEPHPNewbie What are FB dev tools? The oauth API?
 
Anonymous
Well like the FB plugins, the comment, like box..
 
Anonymous
I could be dead wrong about things, but remember that I am only a Noob
 
Think of an API as all things that are public when programming.
 
Anonymous
For example, could we say Discuss is an API?
 
It indeed has an API
It's how you get the comments
 
8:27 PM
@TheCOMPLETEPHPNewbie You pinged @PeeHaa again.
 
Anonymous
@Lusitanian He pinged me first.
 
@DaveRandom WTF is that crap getting upvotes.
 
lol
> You have been mentioned in recycle bin, a room you're not currently in.
 
@Charles I would normally suspect help from "friends" but question history doesn't show this for once. Maybe there are just some generous people around this evening...
 
8:29 PM
They are talking crap about me!
 
:)
 
hello world
 
hello
 
> [INFO] [2012-12-22 21:29:31,263] handshake: @dyelawn
 
8:32 PM
(Don't move to SU, I voted before I QCed it)
 
Questions about dev tools are not off-topic.
This is Too Localized. :p
 
@PeeHaa Skype use port 80 for stuff? O_o
 
> You earned Cake Is Not A Lie on Stack Overflow!
 
@PeeHaa HOW
 
@DaveRandom Yep :P
@Lusitanian 1 sec lemme check
 
8:34 PM
@DaveRandom THAT EXPLAINS SO MUCH. I was incredibly confused yesterday about something related
 
> edit a post, which then gets 5 or more upvotes
 
@PeeHaa ahh
i want
 
wtf it is a sh*t application, now I think even less of it.
 
do you have access to all services in the service container of a bundle loaded in the AppKernel of a symfony2? or do you need to explicitly register the service in your own bundle before you can ->get($it);?
 
8:38 PM
@dyelawn where are you calling $container->get(...)?
 
@igorw TheBundleName:DefaultController:anAction
 
@dyelawn from a controller you have access to all services from the service container (or to make people in this channel happy: the service locator)
 
:)
 
user895378
8:42 PM
:)
 
@igorw the service container/locator within the bundle (e.g. src/MyVendorName/MyBundle/Resources/config/services.yml) or within the scope of the entire application (e.g. app/config/config.[ext] }{ services:)?
 
Anonymous
So the GET[''] is an array, a super global varible, and a parameter, hmmm
 
I want to find the people responsible for turning the term "web services" into a synonym for SOAP. When I find them, I am going to shove soap down their throats until they beg for mercy. </evil>
 
Your code is backwards. I don't even know how one manages something like this... — DaveRandom 7 secs ago
 
@DaveRandom me?
 
8:47 PM
 
@Charles Oooh, oooh, leave some for me
@dyelawn No, the question where I posted that. There are three lines of code in the opposite order to what they should be :S
 
'evening folks :)
 
@DaveRandom phew
 
@dyelawn can you rephrase your question? didn't quite get it
 
@NiekBergman hiya
 
8:50 PM
re-asked with more detail: in this read me github.com/liuggio/ExcelBundle/blob/master/README.md it seems like i could do the following: 1) edit composer.json 2) php composer.phar update 3) edit AppKernel.php 4) call $this->get('xls.service_xls5'); from any controller
 
Anonymous
hi @NiekBergman
 
@dyelawn yes, that is correct. the container is shared between all services and all controllers.
 
@igorw without adding it to the services definition within config.yml?
 
@dyelawn that's not necessary, the bundle adds it. the bundle contains a container extension. the container extension is responsible for parsing configs and loading services into the container based on those configs.
 
Anonymous
In this example, does the actual code have to always be between the database connection and the exception? @DaveRandom


`$id = 5;
try {
$conn = new PDO('mysql:host=localhost;dbname=myDatabase', $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare('SELECT * FROM myTable WHERE id = :id');
$stmt->execute(array('id' => $id));
while($row = $stmt->fetch()) {
print_r($row);
}
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}`
 
Anonymous
8:57 PM
actual code:

`$stmt = $conn->prepare('SELECT * FROM myTable WHERE id = :id');
$stmt->execute(array('id' => $id));
while($row = $stmt->fetch()) {
print_r($row);
} `
 
@TheCOMPLETEPHPNewbie please format the code
 
@igorw so how do you avoid naming conflicts?
 
Anonymous
I did: Check the below

`$id = 5;
try {
$conn = new PDO('mysql:host=localhost;dbname=myDatabase', $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare('SELECT * FROM myTable WHERE id = :id');
$stmt->execute(array('id' => $id));
while($row = $stmt->fetch()) {
print_r($row);
}
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}`
 
@dyelawn it is recommended that service names are somewhat namespaced.
 

« first day (798 days earlier)      last day (4165 days later) »