I want to convert special characters like ñ, Ñ to htmlentities using php.
I tried using htmlentities, but instead of returning "ñ" for its value it returns "ñ" as its value.
Hey, I need help isolating part of a url in PHP.
say I have
http://www.test.com/something/something/important/
How could I isolate the "important"
Thanks!
Hi everybody,
For a web application, I have to make a scientific graph.
You can see an example here :
http://www.ego-network.org/monitoring/plot_deployment.php?glider=eudoxus&deployment=Cascade&posti=4&postj=scaptemperature_lastweek&pposti=4&ppostj=scaoxygen_lastweek&hchk=&defsct=default_scatter
I have 2 coordinates, time and depth, and I want the temperature to be represent by a color, exactly like the example.
Someone know how to make this king of graph ?
Thanks !
I am using PHP's function file_get_contents() to fetch contents of a URL and then I process headers through the variable $http_response_header. Now the problem is that some of the URLs need some data to be posted to the URL (for example, login pages). How do I do that?
I realize using stream_context I may be able to do that but I am not entirely clear.
Thanks.
Hey.
I'd like to check code committed to my remote git repository with PHP CodeSniffer and reject it if there are any problems code standards. Does anyone have an example how to use it on git remote repository or maybe example how to use it with pre-receive hook? Thanks.
Hi,
i have a variable like the following and i want a function to only keep the first 20 lines, so it will strips any additional \n lines more than 20.
<?php
$mytext="Line1
Line2
Line3
....."
keeptwentyline($mytext);
?>
I try to edit ODT-documents programmaticly in PHP. In fact I just want to do some text replacement and adding new rows in a table.
I know that a normal ODF document is an archive containing XML-files. But before I reinvent the wheel: is there any library which does most of the tasks? Or should I just parse the XML-file in a DOM-parser and modify it?
Im building a codeigniter app which uses json_encode to provide ajax data in many places... today I learned that the server has php 5.1.6 which doesnt support this method (or json_decode).. what can I do?? please help.
I have the following script
<?php
echo "I am alive<br>";
die("I am dying<br>");
echo ("Dead");
?>
The output that I get is
I am alive
I am dying
Is there any way (alternative/substitute of die()) using which the execution of the remaining script be continued?
I was wondering if some one can give me an example on how to delete an image using PHP & MySQL?
The image is stored in a folder name thumbs and another named images and the image name is stored in a mysql database.
we have this code:
$value = preg_replace("/[^\w]/", '', $value);
where $value is in utf-8. After this transformation first byte of multibyte characters is stripped. How to make \w cover UTF-8 chars completely?
Sorry, i am not very well in PHP
i have seen a lot of coders choosing this filename convention:
file.class.php.
is this a standard of naming class files?
just curious. so i know if i should follow it for all class files in the future.
thanks
Is there a way to only show the items that are older than a certain date in a php mysql array? I'm using this query method and sorting by lastpost_cl:
$query="SELECT * FROM properties ORDER BY lastpost_cl";
$result=mysql_query($query);
$num = mysql_num_rows ($result);
mysql_close();
and I was thinking the way of checking the time would be:
if (time() <= strtotime($lastpost_cl)) {
}
How can I combine the two and only show lastpost_cl that are older that the current time?
I am trying to get PHP to extract the TOKEN (the uppercase one), USERID (uppercase), and the USER NAME (uppercase) from a web page with the following text.
{"rsp":{"stat":"ok","auth":{"token":"**TOKEN**","perms":"read","user":{"id":"**USERID**","username":"**USER NAME**","fullname":"**NAME OF USER**"}}}}
(This is from the RTM api, getting the authentication token of the user).
How would I go about doing this? Thanks!
What is the Url.Content() of asp.net mvc equivalent in php?
I have a file that use my style.css from both pathes:
'artciles/123/name'
'artciles/123'
How can I use links to static content, witout using absolute urls?
Trying to use php to get all files in a directory and save them locally... It seems like I constantly need to specify a name? Is that right?
function grabFiles() {
$conn = ftp_connect(REMOTE);
@ftp_login($conn, REMOTEUSER, REMOTEPASS);
ftp_get($conn, '*', FTP_BINARY);
}
Hello,
I want to update a blog, by sending an email using php. This is not wordpress, tumblr, or the famous ones.
I could set up an email id, with a specific code in the subject line, but how I get input the contents into the db?
Thanks
Jean
Hay i need help.
I want to find all muliples of a number in PHP.
I'm using something like this
if($count != 20 )
to work out if $count is not equal to 20.
but i also need this script to check if $count is not equal to 20,40,60,80,100,120,140,160 etc.
Any ideas? I think i need to use the modulus symbol (%), but i don't know.
Thanks
What is exact meaning of this statement...
VERIFY THE PARAMETER VALUE ARE IN THEIR EXPECTED RANGE AND TYPE.
I am passing values in POST method through URL in php.
The web server is Apache. I want to rewrite URL so a user won't know the actual directory. For example:
The original URL: www.mydomainname.com/en/piecework/piecework.php?piecework_id=11
Expected URL: piecework.mydomainname.com/en/11
How to achieve it with mod_rewrite?
How do I convert the value of a PHP variable to string? I was looking for something better than concatenating with an empty string:
$myText = $myVar . '';
like the ToString() method in Java or .NET.
for a current webapp i need a "outlook-like" calendar... Here are some requirements for the calendar:
week-view for the appointments
different appointment types
direct display of the length and time of the date (like in googleCalendar)
multiple appointments for the same time
only using javascript, php and any DB
We need the calendar for the Zend Framework, so if the Calendar doesn't already support the ZF, the source needs to be editable!
do you know any calendar which fits my needs? or do you have any tipps for developing one by myself?