## LiDoNg_9_0's Profile User Rating:

Reputation: 9 Worker
Group:
Active Members
Active Posts:
160 (0.1 per day)
Joined:
03-September 09
Profile Views:
3,902
Last Active:
Aug 21 2012 09:05 AM
Currently:
Offline

### Previous Fields

Country:
PL
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Nissan
Dream Kudos:
0

### Latest Visitors

LiDoNg_9_0 I have no status

1. #### In Topic: Sentence difference algorithm

Posted 17 Aug 2012

CTphpnwb, on 17 August 2012 - 07:44 AM, said:

You need to iterate through the arrays manually. Something like this:
```\$s1="grey tiles 100 X 200 kitchen flooring";
\$s2="grey tiles 200 X 600 kitchen flooring";
\$sa1=explode(" ",\$s1);
\$sa2=explode(" ",\$s2);
if(count(\$sa1) < count(\$sa2)) {
\$difference = compare_arrays(\$sa2,\$sa1);
} else {
\$difference = compare_arrays(\$sa1,\$sa2);
}
echo "The Difference =<br>".\$difference;

function compare_arrays(&\$larger, &\$smaller) {
\$n = count(\$smaller);
\$diff = "";
for(\$i = 0; \$i < \$n; \$i++) {
if(\$larger[\$i] != \$smaller[\$i]) {
\$diff .= \$larger[\$i]." vs ".\$smaller[\$i]."<br>";
}
}
\$n = count(\$larger);
while(\$i < \$n) {
if(\$larger[\$i] != \$smaller[\$i]) {
\$diff .= \$larger[\$i]." vs ".\$smaller[\$i]."<br>";
}
\$i++;
}
return \$diff;
}
```

wtf, i've been working to this for the whole day and when I post here it was just like 30 mins or something, somebody just got it right. Your amazing dude. Thanks I appreciate your help.
2. #### In Topic: string slicing / string manipulation

Posted 17 Jul 2012

Astalor, on 17 July 2012 - 09:07 AM, said:

Hello there!

For the task you have mentioned I would suggest looking into using regular expressions, below are some useful links to look at.

PREG functions in PHP (in particular hit up preg_match)
http://www.php.net/m...en/ref.pcre.php

A cheat sheet for regular expressions
http://www.cheatogra...ar-expressions/

Thank you astalor.
I already solved this issue using regular expression. I appreciated your help.
3. #### In Topic: time since posted feature like twitter and facebook

Posted 23 Jan 2012

CTphpnwb, on 23 January 2012 - 07:44 PM, said:

hahaha i don't know what to say. your just giving me the same link as my post.

### My Information

Member Title:
Age:
23 years old
Birthday:
September 9, 1990
Gender:
Location:
Philippines
Interests:
Programming
Full Name:
Sunny Jay Sabuero
Years Programming:
3
Programming Languages:
PHP, VB 6, C/C++

### Contact Information

E-mail:
Private
Yahoo:
LiDoNg_9_0@yahoo.com