Author

Topic: PHP programmer needed (Read 469 times)

hero member
Activity: 576
Merit: 514
April 19, 2016, 03:19:17 PM
#9
LOL. Well ok. Tongue

Just tried to send half of that to Bitsky since his was a much better solution but forgot a zero  Grin
https://www.blocktrail.com/BTC/tx/469547a17e4e625799cc184324b14c1438c9be5fb63cd8f19da9e3d9973f5f5d
Thanks! Smiley

Get 0.001 And pay 0.005, Bitsky you are really lucky
I don't think I'm going to complain Wink

sr. member
Activity: 320
Merit: 261
Web developper
April 19, 2016, 01:23:53 PM
#8
LOL. Well ok. Tongue

Just tried to send half of that to Bitsky since his was a much better solution but forgot a zero  Grin
https://www.blocktrail.com/BTC/tx/469547a17e4e625799cc184324b14c1438c9be5fb63cd8f19da9e3d9973f5f5d

Get 0.001 And pay 0.005, Bitsky you are really lucky
legendary
Activity: 2058
Merit: 1015
April 18, 2016, 11:50:30 PM
#7
LOL. Well ok. Tongue

Just tried to send half of that to Bitsky since his was a much better solution but forgot a zero  Grin
https://www.blocktrail.com/BTC/tx/469547a17e4e625799cc184324b14c1438c9be5fb63cd8f19da9e3d9973f5f5d
sr. member
Activity: 320
Merit: 261
Web developper
sr. member
Activity: 320
Merit: 261
Web developper
April 18, 2016, 09:05:21 PM
#5
Really thank you so much for your reply,its done with VBA yesterday.
legendary
Activity: 2058
Merit: 1015
April 18, 2016, 07:53:56 PM
#4
Why so complex?

Hehe, haven't touched php in a while and it was quite late. But I knew it was bad thus my comment about being a fun exercise and there being better ways Wink

I thought about a pure regex solution later but didn't know the function to cal, I was browsing the docs for each function  as I got to it because I couldn't remember them and I didn't feel like going back at it again, your solution is much better Tongue
hero member
Activity: 576
Merit: 514
April 18, 2016, 03:56:19 PM
#3
Why so complex?

Code:

$tmp 
= <<4. A quick and lively dance. [Obs.]
Make you dance canary With sprightly fire and motion. Shak.

CANARY
Ca*na"ry, v. i.

Defn: To perform the canary dance; to move nimbly; to caper. [Obs.]
But to jig of a tune at the tongue's end, canary to it with your
feet. Shak.
CANARY BIRD
Ca*na"ry bird`. (Zoöl.)

Defn: A small singing bird of the Finch family (Serinus Canarius), a
native of the Canary Islands. It was brought to Europe in the 16th
century, and made a household pet. It generally has a yellowish body
with the wings and tail greenish, but in its wild state it is more
frequently of gray or brown color. It is sometimes called canary
finch.canary.

Canary bird flower (Bot.), a climbing plant (Tropæolum peregrinum)
with canary-colored flowers of peculiar form; -- called also canary
vine.

CANASTER
Ca*nas"ter, n. Etym: [Sp. canasta, canastro, basket, fr. L.
canistrum. See Canister.]

Defn: A kind of tobacco for smoking, made of the dried leaves,
coarsely broken; -- so called from the rush baskets in which it is
packed in South America. McElrath.

CAN BUOY
Can" buoy`.

Defn: See under Buoy, n.

CANCAN
Can"can, n. Etym: [F.]

Defn: A rollicking French dance, accompanied by indecorous or
extravagant postures and gestures.

CANCEL
Can"cel, v. i. [Imp. & p. p. Canceled or Cancelled (; p. pr. & vb. n.
Canceling or Cancelling.] Etym: [L. cancellare to make like a
lattice, to strike or cross out (cf. Fr. canceller, OF. canceler) fr.
cancelli lattice, crossbars, dim. of cancer lattice; cf. Gr.
Chancel.}]
EOF;

echo 
"
";

preg_match_all('/[A-Z]{2,}/s'$tmp$ucwords);
print_r($ucwords[0]);

?>

Result:
Code:
Array
(
    [0] => CANARY
    [1] => CANARY
    [2] => BIRD
    [3] => CANASTER
    [4] => CAN
    [5] => BUOY
    [6] => CANCAN
    [7] => CANCEL
    [8] => OF
)
legendary
Activity: 2058
Merit: 1015
April 18, 2016, 12:43:23 AM
#2
Here's a quick solution, there's probably a more elegant/performant way around however.


Code:
function extractUppercase($str) { 
$ret = array();
$arr preg_split("/[\s,\.\p{P}]+/"$str);

$count count($arr);
for ($i 0$i $count$i++) {                
if ($arr[$i] == strtoupper($arr[$i]) && !empty($arr[$i]) && !is_numeric($arr[$i]))
$ret[] = $arr[$i];
}
return $ret;
}


echo 
"
";


$test '4. A quick and lively dance. [Obs.]
Make you dance canary With sprightly fire and motion. Shak.
CANARY
Ca*na"ry, v. i.
Defn: To perform the canary dance; to move nimbly; to caper. [Obs.]
But to jig of a tune at the tongue\'s end, canary to it with your
feet. Shak.
CANARY BIRD
Ca*na"ry bird`. (Zoöl.)
Defn: A small singing bird of the Finch family (Serinus Canarius), a
native of the Canary Islands. It was brought to Europe in the 16th
century, and made a household pet. It generally has a yellowish body
with the wings and tail greenish, but in its wild state it is more
frequently of gray or brown color. It is sometimes called canary
finch.canary.
Canary bird flower (Bot.), a climbing plant (Tropæolum peregrinum)
with canary-colored flowers of peculiar form; -- called also canary
vine.
CANASTER
Ca*nas"ter, n. Etym: [Sp. canasta, canastro, basket, fr. L.
canistrum. See Canister.]
Defn: A kind of tobacco for smoking, made of the dried leaves,
coarsely broken; -- so called from the rush baskets in which it is
packed in South America. McElrath.
CAN BUOY
Can" buoy`.
Defn: See under Buoy, n.
CANCAN
Can"can, n. Etym: [F.]
Defn: A rollicking French dance, accompanied by indecorous or
extravagant postures and gestures.
CANCEL
Can"cel, v. i. [Imp. & p. p. Canceled or Cancelled (; p. pr. & vb. n.
Canceling or Cancelling.] Etym: [L. cancellare to make like a
lattice, to strike or cross out (cf. Fr. canceller, OF. canceler) fr.
cancelli lattice, crossbars, dim. of cancer lattice; cf. Gr.
Chancel.}]'
;

$result extractUppercase($test);

echo 
"Test:\n\n"$test"\n\n\n\nResult:\n\n";
print_r($result);

echo 
"
"
;
?>

Which leads to this sample output:

Test:

4. A quick and lively dance. [Obs.]
Make you dance canary With sprightly fire and motion. Shak.
CANARY
Ca*na"ry, v. i.
Defn: To perform the canary dance; to move nimbly; to caper. [Obs.]
But to jig of a tune at the tongue's end, canary to it with your
feet. Shak.
CANARY BIRD
Ca*na"ry bird`. (Zoöl.)
Defn: A small singing bird of the Finch family (Serinus Canarius), a
native of the Canary Islands. It was brought to Europe in the 16th
century, and made a household pet. It generally has a yellowish body
with the wings and tail greenish, but in its wild state it is more
frequently of gray or brown color. It is sometimes called canary
finch.canary.
Canary bird flower (Bot.), a climbing plant (Tropæolum peregrinum)
with canary-colored flowers of peculiar form; -- called also canary
vine.
CANASTER
Ca*nas"ter, n. Etym: [Sp. canasta, canastro, basket, fr. L.
canistrum. See Canister.]
Defn: A kind of tobacco for smoking, made of the dried leaves,
coarsely broken; -- so called from the rush baskets in which it is
packed in South America. McElrath.
CAN BUOY
Can" buoy`.
Defn: See under Buoy, n.
CANCAN
Can"can, n. Etym: [F.]
Defn: A rollicking French dance, accompanied by indecorous or
extravagant postures and gestures.
CANCEL
Can"cel, v. i. [Imp. & p. p. Canceled or Cancelled (; p. pr. & vb. n.
Canceling or Cancelling.] Etym: [L. cancellare to make like a
lattice, to strike or cross out (cf. Fr. canceller, OF. canceler) fr.
cancelli lattice, crossbars, dim. of cancer lattice; cf. Gr.
Chancel.}]



Result:

Array
(
    [ 0] => A
    [ 1] => CANARY
    [ 2] => CANARY
    [ 3] => BIRD
    [ 4] => A
    [ 5] => CANASTER
    [ 6] => L
    [ 7] => A
    [ 8] => CAN
    [ 9] => BUOY
    [ 10] => CANCAN
    [ 11] => F
    [ 12] => A
    [ 13] => CANCEL
    [ 14] => L
    [ 15] => OF
)



If it does the deed feel free to send a tip to 12VJryWvJaUNa9LWKVnY38Ds1YMqZjE8L1 otherwise this was a fun exercise Wink
sr. member
Activity: 320
Merit: 261
Web developper
April 17, 2016, 10:11:28 PM
#1
its a easy task for an expert php dev,I will pay at least 0.001BTC maybe more
I wanna an php script that extract only uppercase word from this text:

4. A quick and lively dance. [Obs.]
Make you dance canary With sprightly fire and motion. Shak.

CANARY
Ca*na"ry, v. i.

Defn: To perform the canary dance; to move nimbly; to caper. [Obs.]
But to jig of a tune at the tongue's end, canary to it with your
feet. Shak.
CANARY BIRD
Ca*na"ry bird`. (Zoöl.)

Defn: A small singing bird of the Finch family (Serinus Canarius), a
native of the Canary Islands. It was brought to Europe in the 16th
century, and made a household pet. It generally has a yellowish body
with the wings and tail greenish, but in its wild state it is more
frequently of gray or brown color. It is sometimes called canary
finch.canary.

Canary bird flower (Bot.), a climbing plant (Tropæolum peregrinum)
with canary-colored flowers of peculiar form; -- called also canary
vine.

CANASTER
Ca*nas"ter, n. Etym: [Sp. canasta, canastro, basket, fr. L.
canistrum. See Canister.]

Defn: A kind of tobacco for smoking, made of the dried leaves,
coarsely broken; -- so called from the rush baskets in which it is
packed in South America. McElrath.

CAN BUOY
Can" buoy`.

Defn: See under Buoy, n.

CANCAN
Can"can, n. Etym: [F.]

Defn: A rollicking French dance, accompanied by indecorous or
extravagant postures and gestures.

CANCEL
Can"cel, v. i. [Imp. & p. p. Canceled or Cancelled (; p. pr. & vb. n.
Canceling or Cancelling.] Etym: [L. cancellare to make like a
lattice, to strike or cross out (cf. Fr. canceller, OF. canceler) fr.
cancelli lattice, crossbars, dim. of cancer lattice; cf. Gr.
Chancel.}]


Jump to: