![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
zq29
-
Posts
2,752 -
Joined
-
Last visited
-
Days Won
1
Posts posted by zq29
-
-
You could do this with eregi() and some regex wizardry. Check out regular-expressions.info, and if you get stuck, post your progress and problem in our Regex forum.
-
In my opinion, just reading books is not the best way to learn, you need to actually write some scripts. The manual (php.net) is the best resource for learning PHP I think.
-
I can't think of [i]just one[/i] function that does this, I know a handfull exist for replacements, but not searches, well, none come to mind. YOu could do it like this though:
[code]<?php
$words = array("cat","dog","fish","bucket","cheese","wheel");
$str = "the monkey jumped from the bucket";
$found = array();
foreach($words as $w) {
if(stripos($str,$w) !== FALSE) $found[] = $w;
}
?>[/code] -
Try:
[code]$searchresults = glob("*.txt");[/code]
glob() returns its output as an array. -
The levenshtein() function might be of some use to you...
-
Unless you're thinking of doing a fixed height design, it doesn't really matter how high your canvas is to begin with. With resolution, I believe the standard is 72dpi for web graphics.
-
How is the array structured? $pixels[ x][ y] ?
-
No, as far as I'm aware, there are no dummy/included images packaged with the GD library.
-
I normally start out with a canvas 770px wide, so I can put together a design that looks nice on an 800x600 screenm then in the coding stages adapt the design to either stay fixed width, or scale to the screen size.
-
[quote author=Barand link=topic=101730.msg402850#msg402850 date=1153771454]
[quote]if(substr($l,0,2) != "--") $new .= $l."\r\n";[/quote]
You don't need to add the "\r\n" as they will already be there. file() doesn't strip them.
[/quote]Right you are - I don't always think before I type :) -
No problem :)
-
[code]<?php
foreach(glob("path/to/files/*.txt") as $file) {
echo file_get_contents($file);
}
?>[/code]
[b]EDIT:[/b] Beaten to it! (Again!) -
substr() ?
[b]EDIT:[/b] Beaten to it! -
CSS:
[code]<br style="page-break-before:always;">
//OR
<br style="page-break-after:always;">[/code] -
You'd also need to write some code to filter out the crap like:
[quote]--
-- Table structure for table `users`
-- [/quote]
Of which I guess could be done with something like:
[code]<?php
$new = "";
$file = file("dump.sql");
foreach($file as $l) {
if(substr($l,0,2) != "--") $new .= $l."\r\n";
}
$h = fopen("stripped.sql","wb");
fwrite($h,$new);
fclose($h);
?>[/code] -
I don't fully understand your definition of 'canned' images, but the function imagecreatefrompng() is used to create a new image, but starting with the canvas filled with the contents of an existing image, defined only parameter in the function.
-
[quote author=onlyican link=topic=101662.msg402755#msg402755 date=1153764617]In PHP
You can create an image of a website, and save it a jpg
(imagecreatetruecolor I think, cant remember now)[/quote]
I'd be interested to know how you've managed to achieve that strictly with PHP...
I don't think you're going to be able to do this without the aid of some third party command line software sitting on the server... -
Just as a side note, IE6 does support full transparancy within png images, it doesn't support gradual transparency/opacity.
-
So really, this isn't a PHP question. Maybe try a Flash forum? You might get a better response that way...
-
There is some software called [url=http://www.swftools.org/]SWFTools[/url] that has a command line tool called swfextract which can be used to extract images from an swf file. You could use this tool along with PHPs exec() function to auto-extract frames from the swf - Would this be any use to you?
-
You can use system commands to do this on either Windows or *NIX with something like this:
[code]<?php
exec("ping 192.168.1.1",$out);
echo "<pre>"; print_r($out); echo "</pre>";
?>[/code] -
[url=http://www.phpfreaks.com/forums/index.php/topic,99076.0.html]http://www.phpfreaks.com/forums/index.php/topic,99076.0.html[/url]
-
I started my own web development company up back in Jan 2005 (with an actual office, not from home) and have since been doing that every day. I mainly provide all of the dynamic functionality and more advanced interactivity for a handful of other web design companies, so they design the site, send it to me, and I make it do everything they want - I like it this way as I get to spend my time doing what I like, coding, and not having to deal with the end client, which I don't enjoy doing really. Although I do have a small amount of clients that a manage fully, I much prefer my other work where I do projects for other companies where you can talk to them about the features and possible solutions without them looking at you as though you're speaking another language!
As the saying goes, 'Don't have all of your eggs in one basket', I have also started a web marketing company a couple of months back. Where I just sell other companies products, or get visitors onto the companies site via the affiliate marketing model. This is more of an 'on the side / evenings and weekends' company though and currently does not take up a lot of my time, I can set up a site and leave it to work its magic with just a tweak here and there to optimise traffic.
I'm also in the process of starting up an online shop, selling audio visual accessories. This again won't be taking up too much of my time, as I will be taking some people on to take care of the finances, stock control and order forfillment and I'll "just" be taking care of the web site build and maintenance and general day to day running of the company.
Most of my time is taken up by my main business though, the web development company, I almost allways have a good number of projects on, and lined up to be worked on. Although I think I'd have a problem if I woke up one day to find that the internet has imploded having 3 purely web based businesses! -
In my opinion, you should [i]never[/i] store passwords in plain text form.
[quote]the first parameter is the type sha1, you could use as a type instead of a standalone function, is this true, I also read sha1 has been decrypted somewhere[/quote]I don't quite understand what you mean there, but yes, you can either use the sha1() function, or as an algorythm type within hash(). From what I have read, SHA-1 [i]has[/i] been cracked, but not in a way that is totaly useful. I think it requires a technique similar to brute-forcing, but based on collisions.
[quote]So if I hash something how do I match the text passwords up to see if there the same, is there anychance of it being wrong.[/quote]You hash the string and match it against the stored hash of the password.
passing variable from select dropdown list.
in PHP Coding Help
Posted
[code]<form name="myform" action="page2.php" method="post">
<select name="myselect">
<option value="1">ONE</option>
<option value="2">TWO</option>
</select>
</form>[/code]