Jump to content

Recommended Posts

i don't me to sound ungreatful because im greatful for the reply but that doesn't help me much here is my code

 

<?php

 

 

$data = 'c:\test1.txt';

 

$scrambled = file_get_contents("http://www.chumley.biz/modules/programming9/programming9.php");

 

 

$f = fopen($data, 'w');

 

fwrite($f, $scrambled);

fclose($f);

}

echo $scrambled;

 

 

?>

Link to comment
https://forums.phpfreaks.com/topic/42458-solved-please-help/#findComment-206005
Share on other sites

ok i have the program to make a file but the file says:

 

uoakdshaott< br />rnemtov< br />neetneses< br />hklamoao

 

thats in the text file but i would like it to say:

uoakdshaott

rnemtov

neetneses

hklamoao

 

like this so i don't need the <br /> and i need it to start on a new line please help someone

 

thank you

Link to comment
https://forums.phpfreaks.com/topic/42458-solved-please-help/#findComment-206409
Share on other sites

here you go:

 

<?php

function word_sort($word)

{

$letters = str_split($word);

sort($letters);

return implode("", $letters);

}

 

$data = 'c:\www\chumley\test3.txt';

$handle = file_get_contents('http://www.chumley.biz/modules/programming9/programming9.php');

 

$some = str_replace("< br />", '\n', $handle);

file_put_contents('c:\www\chumley\test3.txt', $some);

 

$scrambled = file("test2.txt");

$unscrambled = file("states.txt");

foreach ($scrambled as $w)

{

foreach($unscrambled as $w2)

{

if(word_sort(trim($w)) == word_sort(trim($w2)))

echo trim($w2).":";

}

}

?>

Link to comment
https://forums.phpfreaks.com/topic/42458-solved-please-help/#findComment-206665
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.